JumpState allows an actor to jump. It gives the actor access to multi or infinite jumps, as well.
public void OnBounce()
Used internally to reset currentJump to 1 when a bounce occurs.
public void OnLadderExit()
Called automatically by LadderState to reset the current jump number to 0 after an actor drops from a ladder.
public bool CanEnd()
Used internally to prevent jumps from ending on their first frame before the actor has fully left the ground.
public void NotifyOfWallJump(int framesToFreeze, Direction.Horizontal kickbackDirection)
Used by WallClingState to notify JumpState that a wall jump has been attempted. This causes the actor to jump from the wall they’re currently attached to. Additionally, it resets currentJump to 0, so that double-jumps or other multi-jumps will reset.
public bool IsHorizontalMovementFrozen()
Returns true if the actor is jumping with a fixed-arc jump (i.e. if freezeHorizontalMovement is true) or if the actor is performing a wall jump and is currently being pushed away from the wall due to kickback frames.
public bool IsJumpActive()
Returns isJumpActive. Will only be true if the actor is currently executing a jump.
public const string idString = “Jumping”
public float speed
The vertical speed of the jump. Faster means higher jumps.
public JumpType type
Whether the jump is Finite, Infinite, or None.
public int multipleJumpNumber
If the jumpType is Finite, this is the total number of jumps the actor can perform before touching the ground.
public bool canMultiJumpOutOfFall
If two or more jumps are enabled, this determines whether or not you can perform additional jumps after falling, even if the initial jump wasn’t initiated on the ground.
public int minFrames
The minimum number of frames the jump can go for. The jump will go on for at least this many frames even if the player releases the jump button beforehand.
public int maxFrames
The maximum number of frames the jump can go for. The jump will terminate after this many frames even if the player is still holding the jump button.
public bool freezeHorizontalMovement
Setting this to True prevents you from maneuvering in midair after a jump is started.
public int hangtimeFrames
The number of frames a jump will hang in the air after cresting and before dropping.
public Animations animations
In addition to its base animation, you can also slot AnimationClips for the Start and Crest of the jump.
public Substate substate
Set to Starting, Body, or Cresting; determines the phase the current jump is in.
public Direction.Horizontal direction
If the jump has been horizontally locked, this saves the direction the jump started in and locks you in.
public bool isGroundedWithJumpButtonUp
If a RexInput is slotted in the RexController, this determines if the actor is on the ground while the jump button is not being pressed. Used when determining if a new jump can be initiated.