〰️Path Constraint
✅
Overview
This component allows the character to travel on a path. This is the connection between the Path Link and the Animal Controller.
Requirements
It requires to have a reference to the Animal component.
How it Works
With the component added to your character, when you get closer to any Path Link the character will activate the nearest path and it will activate the Path Constraint. All the properties to control the animal while is on the path, are set on the Path Link component.
As a recommendation set the Path Constraint inside the Animal Controller internal components, as a child gameObject.
Some paths are not set to be automatic. To activate them you can add an Input connection and use the method TryEnterExitPath()
This also works for exiting a path in the middle of it.
Parameters
Animal
Reference for the Animal Component.
Path
Current Active Path on this Path constraint
Interactions
Forward Offset
Forward point to calculate the path direction. This value must be small. It is used to identify hard turns in the path.
Radius
Radius to search a nearby path. When the Path Constraint sphere trigger and the Path sphere triggers intersect. It means the Character can activate a path.
Offset
An offset of the Radius value relative to the Animal Controller position.
Alignment
Orient Smoothness
Lerp Value to orient the Character to the path. The higher the values the faster the character orient to the path
Align Smoothness
Lerp Value to position the Character to the path. The higher the values the faster the character orient to the path
Events
On Enter Path
Is invoked when the Character has entered a Path
On Exit Path
Is invoked when the Character has exited a Path
Last updated