public struct CharacterMovementHow a character walks. The authored half.
Remarks
Beside a CharacterMovement, PhysicsScene gives an entity a CharacterController and drives it from the entity's MoveIntent — so a walking player is this component, a MoveIntent, and nothing else. What writes the intent is not this assembly's business: a player controller, an AI planner and a replay are indistinguishable from here, which is the point of the seam ([29](../../../docs/plan/29-players-and-possession.md)).
The defaults describe the same human CharacterControllerSettings does — 1.8 m in a 0.3 m capsule — walking at 4 m/s, sprinting at 7, and jumping about 1.1 m.
Fields and properties (17)
public ShapeId ShapeThe collision volume while standing.
public ShapeId CrouchShapeThe collision volume while crouching, or none to make crouching do nothing.
public PhysicsLayer LayerWhich layer the character collides against.
public Vector3 ShapeOffsetWhere the shape's centre sits relative to the entity's origin, in the entity's own frame.
public Vector3 CrouchShapeOffsetThe same, for CrouchShape.
public float WalkSpeedTop speed on the ground, in metres a second.
public float SprintSpeedTop speed while MoveButtons.Sprint is held.
public float CrouchSpeedTop speed while crouched.
public float AccelerationHow hard the character accelerates towards its wanted speed on the ground, in m/s².
public float AirAccelerationThe same, in the air. Usually much smaller.
public float GravityDownward acceleration while not walking, in m/s². Negative.
public float JumpSpeedHow fast the character leaves the ground when it jumps, in metres a second.
public float CoyoteTimeHow long after walking off a ledge a jump still works, in seconds.
public float JumpBufferTimeHow long before landing a jump press is remembered, in seconds.
public float JumpCutSpeedThe upward speed a jump is cut to when the button is released early, in metres a second.
public bool TurnWithAimWhether the character turns to face where its intent says it is looking.
public static CharacterMovement DefaultA human: 4 m/s walking, 7 sprinting, 2 crouched, jumping about 1.1 m under doubled gravity.
Methods (1)
public static float JumpSpeedForHeight(float height, float gravity)The JumpSpeed that reaches a given apex under a given gravity.
Used by (11)
- PlayerRigThirdPersonShooter
- CharacterAllocationTestsVixen.Physics.Tests
- CharacterMotionVixen.Physics
- CharacterMotionTestsVixen.Physics.Tests
- CharacterMovementSystemVixen.Physics
- CharacterSceneTestsVixen.Physics.Tests
- ComponentRegistrationVixen.Physics
- MachineVixen.Net.Physics.Tests
- PhysicsSceneVixen.Physics
- PredictedPlayerMovementTestsVixen.Net.Physics.Tests
- Vixen_Physics_Characters_CharacterMovementSerializerVixen.Physics