Version: 5.3 (switch to 5.4b)
IdiomaEnglish
  • C#
  • JS

Idioma de script

Selecciona tu lenguaje de programación favorito. Todos los fragmentos de código serán mostrados en este lenguaje.

Physics.BoxCastAll

Sugiere un cambio

¡Éxito!

Gracias por ayudarnos a mejorar la calidad de la documentación de Unity. A pesar de que no podemos aceptar todas las sugerencias, leemos cada cambio propuesto por nuestros usuarios y actualizaremos los que sean aplicables.

Cerrar

No se puedo enviar

Por alguna razón su cambio sugerido no pudo ser enviado. Por favor <a>intente nuevamente</a> en unos minutos. Gracias por tomarse un tiempo para ayudarnos a mejorar la calidad de la documentación de Unity.

Cerrar

Cancelar

Cambiar al Manual
public static function BoxCastAll(center: Vector3, halfExtents: Vector3, direction: Vector3, orientation: Quaternion = Quaternion.identity, maxDistance: float = Mathf.Infinity, layermask: int = DefaultRaycastLayers, queryTriggerInteraction: QueryTriggerInteraction = QueryTriggerInteraction.UseGlobal): RaycastHit[];
public static RaycastHit[] BoxCastAll(Vector3 center, Vector3 halfExtents, Vector3 direction, Quaternion orientation = Quaternion.identity, float maxDistance = Mathf.Infinity, int layermask = DefaultRaycastLayers, QueryTriggerInteraction queryTriggerInteraction = QueryTriggerInteraction.UseGlobal);

Parámetros

center Center of the box.
halfExtents Half the size of the box in each dimension.
direction La dirección del rayo.
orientation Rotation of the box.
maxDistance La dirección del rayo.
layermask A Layer mask that is used to selectively ignore colliders when casting a capsule.
queryTriggerInteraction Specifies whether this query should hit Triggers.

Valor de retorno

RaycastHit[] All colliders that were hit.

Descripción

Like Physics.BoxCast, but returns all hits.

Notes: For colliders that overlap the box at the start of the sweep, the output direction is set opposite to the direction of the sweep, distance is set to zero as well as zero vector gets returned in the position field of the RaycastHit structure. You might want to check whether this is the case in your particular query and perform additional queries to refine the result.