Add this script to a CharacterBehavior+CorgiController2D object to make it follow (or try to follow) Player1 So far the Follower will move horizontally towards the player, and use a jetpack to reach it, or jump above obstacles.
More...
|
float | RunDistance = 10f |
| the minimum horizontal distance between the agent and the player at which the agent should start running More...
|
|
float | WalkDistance = 5f |
| the maximum horizontal distance between the agent and the player at which the agent should walk at normal speed More...
|
|
float | StopDistance = 1f |
| the horizontal distance from the player at which the agent will stop moving. Between that distance and the walk distance, the agent will slow down progressively More...
|
|
float | JetpackDistance = 0.2f |
| the minimum vertical distance at which the agent will start jetpacking if the target is above it More...
|
|
Add this script to a CharacterBehavior+CorgiController2D object to make it follow (or try to follow) Player1 So far the Follower will move horizontally towards the player, and use a jetpack to reach it, or jump above obstacles.
◆ Initialization()
virtual void MoreMountains.CorgiEngine.AIFollow.Initialization |
( |
| ) |
|
|
protectedvirtual |
◆ OnDisable()
virtual void MoreMountains.CorgiEngine.AIFollow.OnDisable |
( |
| ) |
|
|
protectedvirtual |
On disable, we stop listening to events
◆ OnEnable()
virtual void MoreMountains.CorgiEngine.AIFollow.OnEnable |
( |
| ) |
|
|
protectedvirtual |
On enable, we start listening for events, or initialize if needed
◆ OnMMEvent()
virtual void MoreMountains.CorgiEngine.AIFollow.OnMMEvent |
( |
CorgiEngineEvent |
corgiEngineEvent | ) |
|
|
virtual |
◆ Update()
virtual void MoreMountains.CorgiEngine.AIFollow.Update |
( |
| ) |
|
|
protectedvirtual |
Every frame, we make the agent move towards the player
◆ _characterHorizontalMovement
◆ _characterJump
◆ _characterRun
CharacterRun MoreMountains.CorgiEngine.AIFollow._characterRun |
|
protected |
◆ _controller
◆ _direction
float MoreMountains.CorgiEngine.AIFollow._direction |
|
protected |
◆ _jetpack
◆ _speed
float MoreMountains.CorgiEngine.AIFollow._speed |
|
protected |
◆ _target
Transform MoreMountains.CorgiEngine.AIFollow._target |
|
protected |
◆ _targetCharacter
Character MoreMountains.CorgiEngine.AIFollow._targetCharacter |
|
protected |
◆ JetpackDistance
float MoreMountains.CorgiEngine.AIFollow.JetpackDistance = 0.2f |
the minimum vertical distance at which the agent will start jetpacking if the target is above it
◆ RunDistance
float MoreMountains.CorgiEngine.AIFollow.RunDistance = 10f |
the minimum horizontal distance between the agent and the player at which the agent should start running
◆ StopDistance
float MoreMountains.CorgiEngine.AIFollow.StopDistance = 1f |
the horizontal distance from the player at which the agent will stop moving. Between that distance and the walk distance, the agent will slow down progressively
◆ WalkDistance
float MoreMountains.CorgiEngine.AIFollow.WalkDistance = 5f |
the maximum horizontal distance between the agent and the player at which the agent should walk at normal speed
◆ AgentFollowsPlayer
bool MoreMountains.CorgiEngine.AIFollow.AgentFollowsPlayer |
|
getset |
true if the agent should follow the player
The documentation for this class was generated from the following file:
- Assets/CorgiEngine/Common/Scripts/Agents/AI/Legacy/AIFollow.cs