RaycastCommand
Create a RaycastCommand.
Read time 2 minutesLast updated 5 days ago
Definition
- Type: Constructor
- Namespace: UnityEngine
- Assembly: UnityEngine.PhysicsModule
RaycastCommand(Vector3, Vector3, QueryParameters, float)
Create a RaycastCommand.
public RaycastCommand(Vector3 from, Vector3 direction, QueryParameters queryParameters, float distance = 3.4028235E+38)
Parameters
The starting point of the ray in world coordinates.
The direction of the ray.
Structure for specifying additional parameters for a batch query such as layer mask, hit multiple mesh faces, hit triggers and hit backfaces.
The maximum distance the ray should check for collisions.
Remarks
The query is run in the default physics scene.
RaycastCommand(PhysicsScene, Vector3, Vector3, QueryParameters, float)
Create a RaycastCommand.
public RaycastCommand(PhysicsScene physicsScene, Vector3 from, Vector3 direction, QueryParameters queryParameters, float distance = 3.4028235E+38)
Parameters
The physics scene to run the raycast query in.
The starting point of the ray in world coordinates.
The direction of the ray.
Structure for specifying additional parameters for a batch query such as layer mask, hit multiple mesh faces, hit triggers and hit backfaces.
The maximum distance the ray should check for collisions.
RaycastCommand(Vector3, Vector3, float, int, int)
Create a RaycastCommand.
public RaycastCommand(Vector3 from, Vector3 direction, float distance = 3.4028235E+38, int layerMask = -5, int maxHits = 1)
Parameters
The starting point of the ray in world coordinates.
The direction of the ray.
The maximum distance the ray should check for collisions.
The maximum number of Colliders the ray can hit.
Remarks
The query is run in the default physics scene.
RaycastCommand(PhysicsScene, Vector3, Vector3, float, int, int)
Create a RaycastCommand.
public RaycastCommand(PhysicsScene physicsScene, Vector3 from, Vector3 direction, float distance = 3.4028235E+38, int layerMask = -5, int maxHits = 1)
Parameters
The physics scene to run the raycast query in.
The starting point of the ray in world coordinates.
The direction of the ray.
The maximum distance the ray should check for collisions.
The maximum number of Colliders the ray can hit.