LandingState allows the actor to play an animation and/or a particle effect upon touching a surface after being airborne. It also provides the option of temporarily stunning the actor if the fall distance was great enough.

Public Methods

public void CheckStun(float distanceFallen)

Used by RexController, which calls this method when the actor lands on a surface after being airborne. If distanceFallen is greater than or equal to the value set for the fallDistanceForStun member, the actor will be temporarily stunned.

Public Members

public const string idString = “Landing”

public float fallDistanceForStun = 0.0f

If the actor falls a greater distance than this, they’ll be stunned for the duration of the landing animation. Setting this to 0.0f disables the stun altogether.

public AnimationClip stunnedAnimation

If the actor is stunned upon landing, this AnimationClip will play during the stun.

public RexPool landingParticlePool

If slotted in the Inspector, this particle will play when the actor first lands on a surface.