Class KCCStateMachine
Have a character controller push any dynamic rigidbody it hits
Namespace: nickmaltbie.OpenKCC.Character
Assembly: cs.temp.dll.dll
Syntax
public class KCCStateMachine : FixedSMAnim
Fields
_cameraControls
Camera controls associated with the player.
Declaration
protected ICameraControls _cameraControls
Field Value
Type | Description |
---|---|
ICameraControls |
jumpActionReference
Action reference for sprinting.
Declaration
public InputActionReference jumpActionReference
Field Value
Type | Description |
---|---|
InputActionReference |
jumpVelocity
Velocity of player jump.
Declaration
public float jumpVelocity
Field Value
Type | Description |
---|---|
Single |
moveActionReference
Have a character controller push any dynamic rigidbody it hits
Declaration
public InputActionReference moveActionReference
Field Value
Type | Description |
---|---|
InputActionReference |
movementEngine
Movement engine for controlling the kinematic character controller.
Declaration
protected KCCMovementEngine movementEngine
Field Value
Type | Description |
---|---|
KCCMovementEngine |
sprintActionReference
Action reference for sprinting.
Declaration
public InputActionReference sprintActionReference
Field Value
Type | Description |
---|---|
InputActionReference |
sprintSpeed
Speed of player when sprinting.
Declaration
public float sprintSpeed
Field Value
Type | Description |
---|---|
Single |
walkingSpeed
Have a character controller push any dynamic rigidbody it hits
Declaration
public float walkingSpeed
Field Value
Type | Description |
---|---|
Single |
Properties
CameraControls
Get the camera controls associated with the state machine.
Declaration
public ICameraControls CameraControls { get; }
Property Value
Type | Description |
---|---|
ICameraControls |
HorizPlaneView
Rotation of the plane the player is viewing
Declaration
public Quaternion HorizPlaneView { get; }
Property Value
Type | Description |
---|---|
Quaternion |
InputMovement
Input movement from player input updated each frame.
Declaration
public Vector3 InputMovement { get; }
Property Value
Type | Description |
---|---|
Vector3 |
MoveAction
Gets the move action associated with this kcc.
Declaration
public InputAction MoveAction { get; set; }
Property Value
Type | Description |
---|---|
InputAction |
SprintAction
Gets the move action associated with this kcc.
Declaration
public InputAction SprintAction { get; set; }
Property Value
Type | Description |
---|---|
InputAction |
Velocity
Current velocity of the player.
Declaration
public Vector3 Velocity { get; protected set; }
Property Value
Type | Description |
---|---|
Vector3 |
Methods
ApplyJump(Vector3)
Have a character controller push any dynamic rigidbody it hits
Declaration
public void ApplyJump(Vector3 velocity)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | velocity |
Awake()
Configure kcc state machine operations.
Declaration
public override void Awake()
FixedUpdate()
Have a character controller push any dynamic rigidbody it hits
Declaration
public override void FixedUpdate()
GetDesiredMovement()
The the player's desired velocity for their current input value.
Declaration
public Vector3 GetDesiredMovement()
Returns
Type | Description |
---|---|
Vector3 | Vector of player velocity based on input movement rotated by player view and projected onto the ground. |
ReadPlayerMovement()
Read the current player input values.
Declaration
public void ReadPlayerMovement()
SetupInputs()
Setup inputs for the KCC
Declaration
public void SetupInputs()
TeleportPlayer(Vector3)
Teleport player to a given position.
Declaration
public void TeleportPlayer(Vector3 position)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | Position to teleport player to. |
Update()
Have a character controller push any dynamic rigidbody it hits
Declaration
public override void Update()
UpdateGroundedState()
Update the grounded state of the kinematic character controller.
Declaration
public void UpdateGroundedState()