Skip to content

PhysicsCast

Aprius edited this page Jan 16, 2025 · 2 revisions

Simple shortcut for Physics cast non alloc

  • RaycastNonAlloc
  • BoxCastNonAlloc
  • CapsuleCastNonAlloc
  • SphereCastNonAlloc
  • OverlapBoxNonAlloc
  • OverlapCapsuleNonAlloc
  • OverlapSphereNonAlloc

Simple

  • RaycastNonAlloc

It's similar to Physics.RaycastNonAlloc but you don't need to worry about initializing RaycastHit[] for results anymore

public DynamicArray<RaycastHit> results = new();


PhysicsCast.v(transform.position, Vector3.right, results);
Clone this wiki locally