When the agent wants to turn significantly, enabling this will make it turn on the spot instead of moving in an arc. This can make for more responsive and natural movement for humanoid characters.
allowRotatingOnSpotBacking
If rotation on the spot is allowed or not.
Public
byte
allowRotatingOnSpotBacking
If rotation on the spot is allowed or not.
1 for allowed, 0 for not allowed.
That we have to use a byte instead of a boolean is due to a Burst limitation.
desiredWallDistance
How big of a distance to try to keep from obstacles.
Public
float
desiredWallDistance
How big of a distance to try to keep from obstacles.
Typically around 1 or 2 times the agent radius is a good value for this.
Try to avoid making it so large that there might not be enough space for the agent to keep this amount of distance from obstacles. It may start to move less optimally if it is not possible to keep this distance.
This works well in open spaces, but if your game consists of a lot of tight corridors, a low, or zero value may be better.
This will be multiplied by the agent's scale to get the actual distance.
leadInRadiusWhenApproachingDestination
How wide of a turn to make when approaching a destination for which a desired facing direction has been set.
Public
float
leadInRadiusWhenApproachingDestination
How wide of a turn to make when approaching a destination for which a desired facing direction has been set.
The following video shows three agents, one with no facing direction set, and then two agents with varying values of the lead in radius.
Setting this to zero will make the agent move directly to the end of the path and rotate on the spot to face the desired facing direction, once it is there.
When approaching a destination for which no desired facing direction has been set, this field has no effect.
Warning
Setting this to a too small (but non-zero) value may look bad if the agent cannot rotate fast enough to stay on the arc.
This will be multiplied by the agent's scale to get the actual radius.
maxOnSpotRotationSpeed
Maximum rotation speed in degrees per second while rotating on the spot.
Public
float
maxOnSpotRotationSpeed
Maximum rotation speed in degrees per second while rotating on the spot.
If the agent would have to rotate faster than this, it will instead slow down to get more time to rotate.
The agent may want to rotate faster than rotationSpeed if there's not enough space, so that it has to move in a more narrow arc. It may also want to rotate faster if it is very close to its destination and it wants to make sure it ends up on the right spot without any circling.
It is recommended to keep this at a value slightly larger than rotationSpeed.
If the agent is in an open area and gets a new destination directly behind itself, it will start to rotate around with exactly this rotation speed.
The agent will slow down its rotation speed as it approaches its desired facing direction. So for example, when it is only 90 degrees away from its desired facing direction, it will only rotate with about half this speed.