Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


SpherecastCommand

Creates a SpherecastCommand.
Read time 2 minutesLast updated 4 days ago

Definition

  • Type: Constructor
  • Namespace: UnityEngine
  • Assembly: UnityEngine.PhysicsModule

SpherecastCommand(Vector3, float, Vector3, QueryParameters, float)

Creates a SpherecastCommand.
public SpherecastCommand(Vector3 origin, float radius, Vector3 direction, QueryParameters queryParameters, float distance = 3.4028235E+38)

Parameters

origin

The starting point of the sphere cast.

radius

The radius of the casting sphere.

direction

The direction of the sphere cast.

queryParameters

Structure for specifying additional parameters for a batch query such as layer mask, hit triggers and hit backfaces.

distance

The maximum distance the cast should check for collisions.

Remarks

The command is run in the default physics scene.

SpherecastCommand(PhysicsScene, Vector3, float, Vector3, QueryParameters, float)

Creates a SpherecastCommand.
public SpherecastCommand(PhysicsScene physicsScene, Vector3 origin, float radius, Vector3 direction, QueryParameters queryParameters, float distance = 3.4028235E+38)

Parameters

physicsScene

The physics scene to run the command in.

origin

The starting point of the sphere cast.

radius

The radius of the casting sphere.

direction

The direction of the sphere cast.

queryParameters

Structure for specifying additional parameters for a batch query such as layer mask, hit triggers and hit backfaces.

distance

The maximum distance the cast should check for collisions.

SpherecastCommand(Vector3, float, Vector3, float, int)

Creates a SpherecastCommand.
Warning
Deprecated. This struct signature is no longer supported. Use struct with a QueryParameters instead
public SpherecastCommand(Vector3 origin, float radius, Vector3 direction, float distance = 3.4028235E+38, int layerMask = -5)

Parameters

origin

The starting point of the sphere cast.

radius

The radius of the casting sphere.

direction

The direction of the sphere cast.

distance

The maximum distance the cast should check for collisions.

layerMask

The LayerMask that selectively ignores Colliders when casting a sphere.

Remarks

The command is run in the default physics scene.

SpherecastCommand(PhysicsScene, Vector3, float, Vector3, float, int)

Creates a SpherecastCommand.
Warning
Deprecated. This struct signature is no longer supported. Use struct with a QueryParameters instead
public SpherecastCommand(PhysicsScene physicsScene, Vector3 origin, float radius, Vector3 direction, float distance = 3.4028235E+38, int layerMask = -5)

Parameters

physicsScene

The physics scene to run the command in.

origin

The starting point of the sphere cast.

radius

The radius of the casting sphere.

direction

The direction of the sphere cast.

distance

The maximum distance the cast should check for collisions.

layerMask

The LayerMask that selectively ignores Colliders when casting a sphere.