Skip to main content

Avoid Vertical Walls

Makes the entities avoid geometry which is at some minimum angle with the xz plane. It also does not affect the entity's direction up and down.

Common usage

This behavior proved to be useful especially for fish in the last sample. There, it serves to keep the fish away from the edge of the pond. In that scenario, the EnvironmentAvoidanceJobWrapper does not work so well, because normals of the sides of the pond are partially up, that would unnecessarily bias the fish to swimming up towards the surface. On the other hand, not affecting the y component of the direction means that the behavior is useless for avoiding the ground, that is why geometry which is not at a steep angle with the xz plane is filtered out.

AvoidVerticalWallsJob

This behavior outputs the following:

  • DesiredDirection - Weighted sum of hits' normals projected on world up.
  • DirectionDesire - 0 to DirectionStrength, as distance to the nearest hit decreases, and the average slope of the hits' surface goes from 0 to 90 degrees.
  • DesiredSpeed - 0 (constant)
  • SpeedDesire - 0 (constant)
  • Priority - Priority (constant)

AvoidVerticalWallsComponent

  • BaseData
    • MaxDistance - Maximum distance where a hit will be detected.
    • DirectionStrength - Multiplies DirectionDesire.
    • Priority - Priority.