Skip to main content

7. Collision Avoidance

Three different entities use EnvironmentAvoidanceJobWrapper, AvoidVerticalWallsJobWrapper and AvoidGroundJobWrapper respectively to avoid collisions with Colliders. The green and red arrows show the raycasts done by the Ray Queries, the orange arrow shows the desired direction.

This is the first sample where Ray Behaviors are used. In the sample, entities follow paths while avoiding their environment. There are three behaviors which serve to avoid collisions - EnvironmentAvoidanceJobWrapper, AvoidGroundJobWrapper and AvoidVerticalWallsJobWrapper. To learn more about the differences between them, visit their documentation. The behaviors use Ray Queries like ConeCreateRaysJobWrapper to detect Colliders.

Minimal Setup folder


The scene contains three entities each with one behavior to avoid collisions activated.

Description of the image