Vixen
02b45cc4
csharp
public struct CharacterState

Where a character is in its own motion. Derived every step.

Read the guide page for this →

Remarks

Not [DataContract], so no scene can carry one — the argument CameraShot makes: a file recording half a coyote window would reload into the middle of a motion nobody asked for. The bridge attaches it to any character that has not got one.

Every timer is here rather than in a field on a system, and that is what makes the motion replayable. A rollback restores the world; anything the rule reads that the world does not hold is something that will be different the second time, and the symptom is a player who mispredicts on a connection with no loss at all ([16](../../../docs/plan/16-networking.md) § Prediction).

Fields and properties (8)

  • public CharacterMoveMode Mode

    What the rules are currently doing to it.

  • public CharacterGround Ground

    What it is standing on, as of the last step.

  • public Vector3 Velocity

    How fast it is moving, in metres a second, relative to whatever it is standing on.

  • public float CoyoteRemaining

    How much longer a jump will still work after leaving the ground, in seconds.

  • public float JumpBufferRemaining

    How much longer a jump press will be remembered, in seconds.

  • public bool JumpHeld

    Whether the jump button was held at the end of the last step.

  • public bool IsCrouching

    Whether the character is crouched — which may be because it cannot stand up.

  • public readonly bool IsGrounded

    Whether it is on ground it can stand on.

Used by (9)

  • CharacterAnimationThirdPersonShooter
  • PlayerRigThirdPersonShooter
  • RespawnWhenBelowThirdPersonShooter
  • CharacterAllocationTestsVixen.Physics.Tests
  • CharacterMotionVixen.Physics
  • CharacterMotionTestsVixen.Physics.Tests
  • CharacterMovementSystemVixen.Physics
  • CharacterSceneTestsVixen.Physics.Tests
  • PhysicsSceneVixen.Physics