Corgi Engine  v8.8
MoreMountains.CorgiEngine.AIFollow Class Reference

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...

Inheritance diagram for MoreMountains.CorgiEngine.AIFollow:
MoreMountains.CorgiEngine.CorgiMonoBehaviour MoreMountains.Tools.MMEventListener< CorgiEngineEvent >

Public Member Functions

virtual void OnMMEvent (CorgiEngineEvent corgiEngineEvent)
 
- Public Member Functions inherited from MoreMountains.Tools.MMEventListener< CorgiEngineEvent >
void OnMMEvent (T eventType)
 

Public Attributes

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...
 

Protected Member Functions

virtual void Initialization ()
 Initialization More...
 
virtual void Update ()
 Every frame, we make the agent move towards the player More...
 
virtual void OnEnable ()
 On enable, we start listening for events, or initialize if needed More...
 
virtual void OnDisable ()
 On disable, we stop listening to events More...
 

Protected Attributes

Transform _target
 
CorgiController _controller
 
Character _targetCharacter
 
CharacterHorizontalMovement _characterHorizontalMovement
 
CharacterRun _characterRun
 
CharacterJump _characterJump
 
CharacterJetpack _jetpack
 
float _speed
 
float _direction
 

Properties

bool AgentFollowsPlayer [get, set]
 true if the agent should follow the player More...
 

Detailed Description

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.

Member Function Documentation

◆ Initialization()

virtual void MoreMountains.CorgiEngine.AIFollow.Initialization ( )
protectedvirtual

Initialization

◆ 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

Member Data Documentation

◆ _characterHorizontalMovement

CharacterHorizontalMovement MoreMountains.CorgiEngine.AIFollow._characterHorizontalMovement
protected

◆ _characterJump

CharacterJump MoreMountains.CorgiEngine.AIFollow._characterJump
protected

◆ _characterRun

CharacterRun MoreMountains.CorgiEngine.AIFollow._characterRun
protected

◆ _controller

CorgiController MoreMountains.CorgiEngine.AIFollow._controller
protected

◆ _direction

float MoreMountains.CorgiEngine.AIFollow._direction
protected

◆ _jetpack

CharacterJetpack MoreMountains.CorgiEngine.AIFollow._jetpack
protected

◆ _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

Property Documentation

◆ 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: