Box Cast

Physics
Tanto lado del cliente como del usuario
Disponible en PC y móvil

Use a box-shaped area with linear motion for detection, and return all entities encountered on the route of the box-shaped area from near to far. If they are initially within the box range, they will not be detected; if the level parameter is filled in, the terrain can be detected

Declaración

func BoxCast(halfExtents Vector3, center Vector3, rotation Vector3, direction Vector3, maxDistance float, layerMask List<int>, includeTrigger bool, out var hitEntities List<entity<Entity>>)
go

Parámetros

Entrada

Nombre Tipo Descripción
Half Extents Vector3 Half the length of the three sides of the box area, only positive values are accepted
Center Vector3 Box area center point
Rotation Vector3 Box area rotation
Direction Vector3 Box area moving direction
Max. Distance Float Box area traverse distance, only positive values are accepted
Layer Mask ListT_int Layer mask, only the filled layers will participate in the scan, leaving it blank means all layers will participate in the scan
Include Trigger Bool Whether the trigger can be detected

Afuera

Nombre Tipo Descripción
Hit Entities ListT_Entity List of entities hit