Kinematic Character Controller
Public Member Functions | Public Attributes | Static Public Attributes | Properties | List of all members
KinematicCharacterController.KinematicCharacterMotor Class Reference

Component that manages character collisions and movement solving More...

Inherits MonoBehaviour.

Public Member Functions

void ValidateData ()
 Handle validating all required values More...
 
void SetCapsuleCollisionsActivation (bool collisionsActive)
 Sets whether or not the capsule collider will detect collisions More...
 
void SetMovementCollisionsSolvingActivation (bool movementCollisionsSolvingActive)
 Sets whether or not the motor will solve collisions when moving (or moved onto) More...
 
void SetGroundSolvingActivation (bool stabilitySolvingActive)
 Sets whether or not grounding will be evaluated for all hits More...
 
void SetPosition (Vector3 position, bool bypassInterpolation=true)
 Sets the character's position directly More...
 
void SetRotation (Quaternion rotation, bool bypassInterpolation=true)
 Sets the character's rotation directly More...
 
void SetPositionAndRotation (Vector3 position, Quaternion rotation, bool bypassInterpolation=true)
 Sets the character's position and rotation directly More...
 
void MoveCharacter (Vector3 toPosition)
 Moves the character position, taking all movement collision solving int account. The actual move is done the next time the motor updates are called More...
 
void RotateCharacter (Quaternion toRotation)
 Moves the character rotation. The actual move is done the next time the motor updates are called More...
 
KinematicCharacterMotorState GetState ()
 Returns all the state information of the motor that is pertinent for simulation More...
 
void ApplyState (KinematicCharacterMotorState state, bool bypassInterpolation=true)
 Applies a motor state instantly More...
 
void SetCapsuleDimensions (float radius, float height, float yOffset)
 Resizes capsule. ALso caches importand capsule size data More...
 
void UpdatePhase1 (float deltaTime)
 Update phase 1 is meant to be called after physics movers have calculated their velocities, but before they have simulated their goal positions/rotations. It is responsible for: More...
 
void UpdatePhase2 (float deltaTime)
 Update phase 2 is meant to be called after physics movers have simulated their goal positions/rotations. At the end of this, the TransientPosition/Rotation values will be up-to-date with where the motor should be at the end of its move. It is responsible for: More...
 
void ProbeGround (ref Vector3 probingPosition, Quaternion atRotation, float probingDistance, ref CharacterGroundingReport groundingReport)
 Probes for valid ground and midifies the input transientPosition if ground snapping occurs More...
 
void ForceUnground (float time=0.1f)
 Forces the character to unground itself on its next grounding update More...
 
bool MustUnground ()
 
Vector3 GetDirectionTangentToSurface (Vector3 direction, Vector3 surfaceNormal)
 Returns the direction adjusted to be tangent to a specified surface normal relatively to the character's up direction. Useful for reorienting a direction on a slope without any lateral deviation in trajectory More...
 
void SetTransientPosition (Vector3 newPos)
 
virtual void HandleVelocityProjection (ref Vector3 velocity, Vector3 obstructionNormal, bool stableOnHit)
 Allows you to override the way velocity is projected on an obstruction More...
 
virtual void HandleSimulatedRigidbodyInteraction (ref Vector3 processedVelocity, RigidbodyProjectionHit hit, float deltaTime)
 Allows you to override the way hit rigidbodies are pushed / interacted with. ProcessedVelocity is what must be modified if this interaction affects the character's velocity. More...
 
void ComputeCollisionResolutionForHitBody (Vector3 hitNormal, Vector3 characterVelocity, Vector3 bodyVelocity, float characterToBodyMassRatio, out Vector3 velocityChangeOnCharacter, out Vector3 velocityChangeOnBody)
 
void EvaluateHitStability (Collider hitCollider, Vector3 hitNormal, Vector3 hitPoint, Vector3 atCharacterPosition, Quaternion atCharacterRotation, Vector3 withCharacterVelocity, ref HitStabilityReport stabilityReport)
 Determines if the motor is considered stable on a given hit More...
 
Vector3 GetVelocityFromRigidbodyMovement (Rigidbody interactiveRigidbody, Vector3 atPoint, float deltaTime)
 Get true linear velocity (taking into account rotational velocity) on a given point of a rigidbody More...
 
Vector3 GetVelocityForMovePosition (Vector3 fromPosition, Vector3 toPosition, float deltaTime)
 Calculates the velocity required to move the character to the target position over a specific deltaTime. Useful for when you wish to work with positions rather than velocities in the UpdateVelocity callback More...
 
Vector3 GetVelocityFromMovement (Vector3 movement, float deltaTime)
 
int CharacterCollisionsOverlap (Vector3 position, Quaternion rotation, Collider[] overlappedColliders, float inflate=0f, bool acceptOnlyStableGroundLayer=false)
 Detect if the character capsule is overlapping with anything collidable More...
 
int CharacterOverlap (Vector3 position, Quaternion rotation, Collider[] overlappedColliders, LayerMask layers, QueryTriggerInteraction triggerInteraction, float inflate=0f)
 Detect if the character capsule is overlapping with anything More...
 
int CharacterCollisionsSweep (Vector3 position, Quaternion rotation, Vector3 direction, float distance, out RaycastHit closestHit, RaycastHit[] hits, float inflate=0f, bool acceptOnlyStableGroundLayer=false)
 Sweeps the capsule's volume to detect collision hits More...
 
int CharacterSweep (Vector3 position, Quaternion rotation, Vector3 direction, float distance, out RaycastHit closestHit, RaycastHit[] hits, LayerMask layers, QueryTriggerInteraction triggerInteraction, float inflate=0f)
 Sweeps the capsule's volume to detect hits More...
 
int CharacterCollisionsRaycast (Vector3 position, Vector3 direction, float distance, out RaycastHit closestHit, RaycastHit[] hits, bool acceptOnlyStableGroundLayer=false)
 Raycasts to detect collision hits More...
 

Public Attributes

CapsuleCollider Capsule
 The capsule collider of this motor More...
 
float GroundDetectionExtraDistance = 0f
 Increases the range of ground detection, to allow snapping to ground at very high speeds More...
 
float MaxStableSlopeAngle = 60f
 Maximum slope angle on which the character can be stable More...
 
LayerMask StableGroundLayers = -1
 Which layers can the character be considered stable on More...
 
bool DiscreteCollisionEvents = false
 Notifies the Character Controller when discrete collisions are detected More...
 
StepHandlingMethod StepHandling = StepHandlingMethod.Standard
 Handles properly detecting grounding status on steps, but has a performance cost. More...
 
float MaxStepHeight = 0.5f
 Maximum height of a step which the character can climb More...
 
bool AllowSteppingWithoutStableGrounding = false
 Can the character step up obstacles even if it is not currently stable? More...
 
float MinRequiredStepDepth = 0.1f
 Minimum length of a step that the character can step on (used in Extra stepping method. Use this to let the character step on steps that are smaller that its radius More...
 
bool LedgeAndDenivelationHandling = true
 Handles properly detecting ledge information and grounding status, but has a performance cost. More...
 
float MaxStableDistanceFromLedge = 0.5f
 The distance from the capsule central axis at which the character can stand on a ledge and still be stable More...
 
float MaxVelocityForLedgeSnap = 0f
 Prevents snapping to ground on ledges beyond a certain velocity More...
 
float MaxStableDenivelationAngle = 180f
 The maximun downward slope angle change that the character can be subjected to and still be snapping to the ground More...
 
bool InteractiveRigidbodyHandling = true
 Handles properly being pushed by and standing on PhysicsMovers or dynamic rigidbodies. Also handles pushing dynamic rigidbodies More...
 
RigidbodyInteractionType RigidbodyInteractionType
 How the character interacts with non-kinematic rigidbodies. "Kinematic" mode means the character pushes the rigidbodies with infinite force (as a kinematic body would). "SimulatedDynamic" pushes the rigidbodies with a simulated mass value. More...
 
float SimulatedCharacterMass = 1f
 
bool PreserveAttachedRigidbodyMomentum = true
 Determines if the character preserves moving platform velocities when de-grounding from them More...
 
bool HasPlanarConstraint = false
 Determines if the character's movement uses the planar constraint More...
 
Vector3 PlanarConstraintAxis = Vector3.forward
 Defines the plane that the character's movement is constrained on, if HasMovementConstraintPlane is active More...
 
int MaxMovementIterations = 5
 How many times can we sweep for movement per update More...
 
int MaxDecollisionIterations = 1
 How many times can we check for decollision per update More...
 
bool CheckMovementInitialOverlaps = true
 Checks for overlaps before casting movement, making sure all collisions are detected even when already intersecting geometry (has a performance cost, but provides safety against tunneling through colliders) More...
 
bool KillVelocityWhenExceedMaxMovementIterations = true
 Sets the velocity to zero if exceed max movement iterations More...
 
bool KillRemainingMovementWhenExceedMaxMovementIterations = true
 Sets the remaining movement to zero if exceed max movement iterations More...
 
CharacterGroundingReport GroundingStatus = new CharacterGroundingReport()
 Contains the current grounding information More...
 
CharacterTransientGroundingReport LastGroundingStatus = new CharacterTransientGroundingReport()
 Contains the previous grounding information More...
 
LayerMask CollidableLayers = -1
 Specifies the LayerMask that the character's movement algorithm can detect collisions with. By default, this uses the rigidbody's layer's collision matrix More...
 
ICharacterController CharacterController
 The motor's assigned controller More...
 
bool LastMovementIterationFoundAnyGround
 Did the motor's last swept collision detection find a ground? More...
 
int IndexInCharacterSystem
 Index of this motor in KinematicCharacterSystem arrays More...
 
Vector3 InitialTickPosition
 Remembers initial position before all simulation are done More...
 
Quaternion InitialTickRotation
 Remembers initial rotation before all simulation are done More...
 
Rigidbody AttachedRigidbodyOverride
 Specifies a Rigidbody to stay attached to More...
 
Vector3 BaseVelocity
 The character's velocity resulting from direct movement More...
 

Static Public Attributes

const int MaxHitsBudget = 16
 
const int MaxCollisionBudget = 16
 
const int MaxGroundingSweepIterations = 2
 
const int MaxSteppingSweepIterations = 3
 
const int MaxRigidbodyOverlapsCount = 16
 
const float CollisionOffset = 0.01f
 
const float GroundProbeReboundDistance = 0.02f
 
const float MinimumGroundProbingDistance = 0.005f
 
const float GroundProbingBackstepDistance = 0.1f
 
const float SweepProbingBackstepDistance = 0.002f
 
const float SecondaryProbesVertical = 0.02f
 
const float SecondaryProbesHorizontal = 0.001f
 
const float MinVelocityMagnitude = 0.01f
 
const float SteppingForwardDistance = 0.03f
 
const float MinDistanceForLedge = 0.05f
 
const float CorrelationForVerticalObstruction = 0.01f
 
const float ExtraSteppingForwardDistance = 0.01f
 
const float ExtraStepHeightPadding = 0.01f
 

Properties

Transform Transform [get]
 The Transform of the character motor More...
 
Vector3 TransientPosition [get]
 The character's goal position in its movement calculations (always up-to-date during the character update phase) More...
 
Vector3 CharacterUp [get]
 The character's up direction (always up-to-date during the character update phase) More...
 
Vector3 CharacterForward [get]
 The character's forward direction (always up-to-date during the character update phase) More...
 
Vector3 CharacterRight [get]
 The character's right direction (always up-to-date during the character update phase) More...
 
Vector3 InitialSimulationPosition [get]
 The character's position before the movement calculations began More...
 
Quaternion InitialSimulationRotation [get]
 The character's rotation before the movement calculations began More...
 
Rigidbody AttachedRigidbody [get]
 Represents the Rigidbody to stay attached to More...
 
Vector3 CharacterTransformToCapsuleCenter [get]
 Vector3 from the character transform position to the capsule center More...
 
Vector3 CharacterTransformToCapsuleBottom [get]
 Vector3 from the character transform position to the capsule bottom More...
 
Vector3 CharacterTransformToCapsuleTop [get]
 Vector3 from the character transform position to the capsule top More...
 
Vector3 CharacterTransformToCapsuleBottomHemi [get]
 Vector3 from the character transform position to the capsule bottom hemi center More...
 
Vector3 CharacterTransformToCapsuleTopHemi [get]
 Vector3 from the character transform position to the capsule top hemi center More...
 
Vector3 AttachedRigidbodyVelocity [get]
 The character's velocity resulting from standing on rigidbodies or PhysicsMover More...
 
int OverlapsCount [get]
 The number of overlaps detected so far during character update (is reset at the beginning of the update) More...
 
OverlapResult[] Overlaps [get]
 The overlaps detected so far during character update More...
 
Quaternion TransientRotation [get]
 The character's goal rotation in its movement calculations (always up-to-date during the character update phase) More...
 
Vector3 Velocity [get]
 The character's total velocity, including velocity from standing on rigidbodies or PhysicsMover More...
 

Detailed Description

Component that manages character collisions and movement solving

Member Function Documentation

◆ ApplyState()

void KinematicCharacterController.KinematicCharacterMotor.ApplyState ( KinematicCharacterMotorState  state,
bool  bypassInterpolation = true 
)

Applies a motor state instantly

◆ CharacterCollisionsOverlap()

int KinematicCharacterController.KinematicCharacterMotor.CharacterCollisionsOverlap ( Vector3  position,
Quaternion  rotation,
Collider[]  overlappedColliders,
float  inflate = 0f,
bool  acceptOnlyStableGroundLayer = false 
)

Detect if the character capsule is overlapping with anything collidable

Returns
Returns number of overlaps

◆ CharacterCollisionsRaycast()

int KinematicCharacterController.KinematicCharacterMotor.CharacterCollisionsRaycast ( Vector3  position,
Vector3  direction,
float  distance,
out RaycastHit  closestHit,
RaycastHit[]  hits,
bool  acceptOnlyStableGroundLayer = false 
)

Raycasts to detect collision hits

Returns
Returns the number of hits

◆ CharacterCollisionsSweep()

int KinematicCharacterController.KinematicCharacterMotor.CharacterCollisionsSweep ( Vector3  position,
Quaternion  rotation,
Vector3  direction,
float  distance,
out RaycastHit  closestHit,
RaycastHit[]  hits,
float  inflate = 0f,
bool  acceptOnlyStableGroundLayer = false 
)

Sweeps the capsule's volume to detect collision hits

Returns
Returns the number of hits

◆ CharacterOverlap()

int KinematicCharacterController.KinematicCharacterMotor.CharacterOverlap ( Vector3  position,
Quaternion  rotation,
Collider[]  overlappedColliders,
LayerMask  layers,
QueryTriggerInteraction  triggerInteraction,
float  inflate = 0f 
)

Detect if the character capsule is overlapping with anything

Returns
Returns number of overlaps

◆ CharacterSweep()

int KinematicCharacterController.KinematicCharacterMotor.CharacterSweep ( Vector3  position,
Quaternion  rotation,
Vector3  direction,
float  distance,
out RaycastHit  closestHit,
RaycastHit[]  hits,
LayerMask  layers,
QueryTriggerInteraction  triggerInteraction,
float  inflate = 0f 
)

Sweeps the capsule's volume to detect hits

Returns
Returns the number of hits

◆ EvaluateHitStability()

void KinematicCharacterController.KinematicCharacterMotor.EvaluateHitStability ( Collider  hitCollider,
Vector3  hitNormal,
Vector3  hitPoint,
Vector3  atCharacterPosition,
Quaternion  atCharacterRotation,
Vector3  withCharacterVelocity,
ref HitStabilityReport  stabilityReport 
)

Determines if the motor is considered stable on a given hit

◆ ForceUnground()

void KinematicCharacterController.KinematicCharacterMotor.ForceUnground ( float  time = 0.1f)

Forces the character to unground itself on its next grounding update

◆ GetDirectionTangentToSurface()

Vector3 KinematicCharacterController.KinematicCharacterMotor.GetDirectionTangentToSurface ( Vector3  direction,
Vector3  surfaceNormal 
)

Returns the direction adjusted to be tangent to a specified surface normal relatively to the character's up direction. Useful for reorienting a direction on a slope without any lateral deviation in trajectory

◆ GetState()

KinematicCharacterMotorState KinematicCharacterController.KinematicCharacterMotor.GetState ( )

Returns all the state information of the motor that is pertinent for simulation

◆ GetVelocityForMovePosition()

Vector3 KinematicCharacterController.KinematicCharacterMotor.GetVelocityForMovePosition ( Vector3  fromPosition,
Vector3  toPosition,
float  deltaTime 
)

Calculates the velocity required to move the character to the target position over a specific deltaTime. Useful for when you wish to work with positions rather than velocities in the UpdateVelocity callback

◆ GetVelocityFromRigidbodyMovement()

Vector3 KinematicCharacterController.KinematicCharacterMotor.GetVelocityFromRigidbodyMovement ( Rigidbody  interactiveRigidbody,
Vector3  atPoint,
float  deltaTime 
)

Get true linear velocity (taking into account rotational velocity) on a given point of a rigidbody

◆ HandleSimulatedRigidbodyInteraction()

virtual void KinematicCharacterController.KinematicCharacterMotor.HandleSimulatedRigidbodyInteraction ( ref Vector3  processedVelocity,
RigidbodyProjectionHit  hit,
float  deltaTime 
)
virtual

Allows you to override the way hit rigidbodies are pushed / interacted with. ProcessedVelocity is what must be modified if this interaction affects the character's velocity.

◆ HandleVelocityProjection()

virtual void KinematicCharacterController.KinematicCharacterMotor.HandleVelocityProjection ( ref Vector3  velocity,
Vector3  obstructionNormal,
bool  stableOnHit 
)
virtual

Allows you to override the way velocity is projected on an obstruction

◆ MoveCharacter()

void KinematicCharacterController.KinematicCharacterMotor.MoveCharacter ( Vector3  toPosition)

Moves the character position, taking all movement collision solving int account. The actual move is done the next time the motor updates are called

◆ ProbeGround()

void KinematicCharacterController.KinematicCharacterMotor.ProbeGround ( ref Vector3  probingPosition,
Quaternion  atRotation,
float  probingDistance,
ref CharacterGroundingReport  groundingReport 
)

Probes for valid ground and midifies the input transientPosition if ground snapping occurs

◆ RotateCharacter()

void KinematicCharacterController.KinematicCharacterMotor.RotateCharacter ( Quaternion  toRotation)

Moves the character rotation. The actual move is done the next time the motor updates are called

◆ SetCapsuleCollisionsActivation()

void KinematicCharacterController.KinematicCharacterMotor.SetCapsuleCollisionsActivation ( bool  collisionsActive)

Sets whether or not the capsule collider will detect collisions

◆ SetCapsuleDimensions()

void KinematicCharacterController.KinematicCharacterMotor.SetCapsuleDimensions ( float  radius,
float  height,
float  yOffset 
)

Resizes capsule. ALso caches importand capsule size data

◆ SetGroundSolvingActivation()

void KinematicCharacterController.KinematicCharacterMotor.SetGroundSolvingActivation ( bool  stabilitySolvingActive)

Sets whether or not grounding will be evaluated for all hits

◆ SetMovementCollisionsSolvingActivation()

void KinematicCharacterController.KinematicCharacterMotor.SetMovementCollisionsSolvingActivation ( bool  movementCollisionsSolvingActive)

Sets whether or not the motor will solve collisions when moving (or moved onto)

◆ SetPosition()

void KinematicCharacterController.KinematicCharacterMotor.SetPosition ( Vector3  position,
bool  bypassInterpolation = true 
)

Sets the character's position directly

◆ SetPositionAndRotation()

void KinematicCharacterController.KinematicCharacterMotor.SetPositionAndRotation ( Vector3  position,
Quaternion  rotation,
bool  bypassInterpolation = true 
)

Sets the character's position and rotation directly

◆ SetRotation()

void KinematicCharacterController.KinematicCharacterMotor.SetRotation ( Quaternion  rotation,
bool  bypassInterpolation = true 
)

Sets the character's rotation directly

◆ UpdatePhase1()

void KinematicCharacterController.KinematicCharacterMotor.UpdatePhase1 ( float  deltaTime)

Update phase 1 is meant to be called after physics movers have calculated their velocities, but before they have simulated their goal positions/rotations. It is responsible for:

  • Initializing all values for update
  • Handling MovePosition calls
  • Solving initial collision overlaps
  • Ground probing
  • Handle detecting potential interactable rigidbodies

◆ UpdatePhase2()

void KinematicCharacterController.KinematicCharacterMotor.UpdatePhase2 ( float  deltaTime)

Update phase 2 is meant to be called after physics movers have simulated their goal positions/rotations. At the end of this, the TransientPosition/Rotation values will be up-to-date with where the motor should be at the end of its move. It is responsible for:

  • Solving Rotation
  • Handle MoveRotation calls
  • Solving potential attached rigidbody overlaps
  • Solving Velocity
  • Applying planar constraint

◆ ValidateData()

void KinematicCharacterController.KinematicCharacterMotor.ValidateData ( )

Handle validating all required values

Member Data Documentation

◆ AllowSteppingWithoutStableGrounding

bool KinematicCharacterController.KinematicCharacterMotor.AllowSteppingWithoutStableGrounding = false

Can the character step up obstacles even if it is not currently stable?


◆ AttachedRigidbodyOverride

Rigidbody KinematicCharacterController.KinematicCharacterMotor.AttachedRigidbodyOverride

Specifies a Rigidbody to stay attached to

◆ BaseVelocity

Vector3 KinematicCharacterController.KinematicCharacterMotor.BaseVelocity

The character's velocity resulting from direct movement

◆ Capsule

CapsuleCollider KinematicCharacterController.KinematicCharacterMotor.Capsule

The capsule collider of this motor

◆ CharacterController

ICharacterController KinematicCharacterController.KinematicCharacterMotor.CharacterController

The motor's assigned controller

◆ CheckMovementInitialOverlaps

bool KinematicCharacterController.KinematicCharacterMotor.CheckMovementInitialOverlaps = true

Checks for overlaps before casting movement, making sure all collisions are detected even when already intersecting geometry (has a performance cost, but provides safety against tunneling through colliders)

◆ CollidableLayers

LayerMask KinematicCharacterController.KinematicCharacterMotor.CollidableLayers = -1

Specifies the LayerMask that the character's movement algorithm can detect collisions with. By default, this uses the rigidbody's layer's collision matrix

◆ DiscreteCollisionEvents

bool KinematicCharacterController.KinematicCharacterMotor.DiscreteCollisionEvents = false

Notifies the Character Controller when discrete collisions are detected


◆ GroundDetectionExtraDistance

float KinematicCharacterController.KinematicCharacterMotor.GroundDetectionExtraDistance = 0f

Increases the range of ground detection, to allow snapping to ground at very high speeds


◆ GroundingStatus

CharacterGroundingReport KinematicCharacterController.KinematicCharacterMotor.GroundingStatus = new CharacterGroundingReport()

Contains the current grounding information

◆ HasPlanarConstraint

bool KinematicCharacterController.KinematicCharacterMotor.HasPlanarConstraint = false

Determines if the character's movement uses the planar constraint

◆ IndexInCharacterSystem

int KinematicCharacterController.KinematicCharacterMotor.IndexInCharacterSystem

Index of this motor in KinematicCharacterSystem arrays

◆ InitialTickPosition

Vector3 KinematicCharacterController.KinematicCharacterMotor.InitialTickPosition

Remembers initial position before all simulation are done

◆ InitialTickRotation

Quaternion KinematicCharacterController.KinematicCharacterMotor.InitialTickRotation

Remembers initial rotation before all simulation are done

◆ InteractiveRigidbodyHandling

bool KinematicCharacterController.KinematicCharacterMotor.InteractiveRigidbodyHandling = true

Handles properly being pushed by and standing on PhysicsMovers or dynamic rigidbodies. Also handles pushing dynamic rigidbodies

◆ KillRemainingMovementWhenExceedMaxMovementIterations

bool KinematicCharacterController.KinematicCharacterMotor.KillRemainingMovementWhenExceedMaxMovementIterations = true

Sets the remaining movement to zero if exceed max movement iterations

◆ KillVelocityWhenExceedMaxMovementIterations

bool KinematicCharacterController.KinematicCharacterMotor.KillVelocityWhenExceedMaxMovementIterations = true

Sets the velocity to zero if exceed max movement iterations

◆ LastGroundingStatus

CharacterTransientGroundingReport KinematicCharacterController.KinematicCharacterMotor.LastGroundingStatus = new CharacterTransientGroundingReport()

Contains the previous grounding information

◆ LastMovementIterationFoundAnyGround

bool KinematicCharacterController.KinematicCharacterMotor.LastMovementIterationFoundAnyGround

Did the motor's last swept collision detection find a ground?

◆ LedgeAndDenivelationHandling

bool KinematicCharacterController.KinematicCharacterMotor.LedgeAndDenivelationHandling = true

Handles properly detecting ledge information and grounding status, but has a performance cost.

◆ MaxDecollisionIterations

int KinematicCharacterController.KinematicCharacterMotor.MaxDecollisionIterations = 1

How many times can we check for decollision per update

◆ MaxMovementIterations

int KinematicCharacterController.KinematicCharacterMotor.MaxMovementIterations = 5

How many times can we sweep for movement per update

◆ MaxStableDenivelationAngle

float KinematicCharacterController.KinematicCharacterMotor.MaxStableDenivelationAngle = 180f

The maximun downward slope angle change that the character can be subjected to and still be snapping to the ground


◆ MaxStableDistanceFromLedge

float KinematicCharacterController.KinematicCharacterMotor.MaxStableDistanceFromLedge = 0.5f

The distance from the capsule central axis at which the character can stand on a ledge and still be stable


◆ MaxStableSlopeAngle

float KinematicCharacterController.KinematicCharacterMotor.MaxStableSlopeAngle = 60f

Maximum slope angle on which the character can be stable


◆ MaxStepHeight

float KinematicCharacterController.KinematicCharacterMotor.MaxStepHeight = 0.5f

Maximum height of a step which the character can climb


◆ MaxVelocityForLedgeSnap

float KinematicCharacterController.KinematicCharacterMotor.MaxVelocityForLedgeSnap = 0f

Prevents snapping to ground on ledges beyond a certain velocity


◆ MinRequiredStepDepth

float KinematicCharacterController.KinematicCharacterMotor.MinRequiredStepDepth = 0.1f

Minimum length of a step that the character can step on (used in Extra stepping method. Use this to let the character step on steps that are smaller that its radius


◆ PlanarConstraintAxis

Vector3 KinematicCharacterController.KinematicCharacterMotor.PlanarConstraintAxis = Vector3.forward

Defines the plane that the character's movement is constrained on, if HasMovementConstraintPlane is active

◆ PreserveAttachedRigidbodyMomentum

bool KinematicCharacterController.KinematicCharacterMotor.PreserveAttachedRigidbodyMomentum = true

Determines if the character preserves moving platform velocities when de-grounding from them

◆ RigidbodyInteractionType

RigidbodyInteractionType KinematicCharacterController.KinematicCharacterMotor.RigidbodyInteractionType

How the character interacts with non-kinematic rigidbodies. "Kinematic" mode means the character pushes the rigidbodies with infinite force (as a kinematic body would). "SimulatedDynamic" pushes the rigidbodies with a simulated mass value.

◆ StableGroundLayers

LayerMask KinematicCharacterController.KinematicCharacterMotor.StableGroundLayers = -1

Which layers can the character be considered stable on


◆ StepHandling

StepHandlingMethod KinematicCharacterController.KinematicCharacterMotor.StepHandling = StepHandlingMethod.Standard

Handles properly detecting grounding status on steps, but has a performance cost.

Property Documentation

◆ AttachedRigidbody

Rigidbody KinematicCharacterController.KinematicCharacterMotor.AttachedRigidbody
get

Represents the Rigidbody to stay attached to

◆ AttachedRigidbodyVelocity

Vector3 KinematicCharacterController.KinematicCharacterMotor.AttachedRigidbodyVelocity
get

The character's velocity resulting from standing on rigidbodies or PhysicsMover

◆ CharacterForward

Vector3 KinematicCharacterController.KinematicCharacterMotor.CharacterForward
get

The character's forward direction (always up-to-date during the character update phase)

◆ CharacterRight

Vector3 KinematicCharacterController.KinematicCharacterMotor.CharacterRight
get

The character's right direction (always up-to-date during the character update phase)

◆ CharacterTransformToCapsuleBottom

Vector3 KinematicCharacterController.KinematicCharacterMotor.CharacterTransformToCapsuleBottom
get

Vector3 from the character transform position to the capsule bottom

◆ CharacterTransformToCapsuleBottomHemi

Vector3 KinematicCharacterController.KinematicCharacterMotor.CharacterTransformToCapsuleBottomHemi
get

Vector3 from the character transform position to the capsule bottom hemi center

◆ CharacterTransformToCapsuleCenter

Vector3 KinematicCharacterController.KinematicCharacterMotor.CharacterTransformToCapsuleCenter
get

Vector3 from the character transform position to the capsule center

◆ CharacterTransformToCapsuleTop

Vector3 KinematicCharacterController.KinematicCharacterMotor.CharacterTransformToCapsuleTop
get

Vector3 from the character transform position to the capsule top

◆ CharacterTransformToCapsuleTopHemi

Vector3 KinematicCharacterController.KinematicCharacterMotor.CharacterTransformToCapsuleTopHemi
get

Vector3 from the character transform position to the capsule top hemi center

◆ CharacterUp

Vector3 KinematicCharacterController.KinematicCharacterMotor.CharacterUp
get

The character's up direction (always up-to-date during the character update phase)

◆ InitialSimulationPosition

Vector3 KinematicCharacterController.KinematicCharacterMotor.InitialSimulationPosition
get

The character's position before the movement calculations began

◆ InitialSimulationRotation

Quaternion KinematicCharacterController.KinematicCharacterMotor.InitialSimulationRotation
get

The character's rotation before the movement calculations began

◆ Overlaps

OverlapResult [] KinematicCharacterController.KinematicCharacterMotor.Overlaps
get

The overlaps detected so far during character update

◆ OverlapsCount

int KinematicCharacterController.KinematicCharacterMotor.OverlapsCount
get

The number of overlaps detected so far during character update (is reset at the beginning of the update)

◆ Transform

Transform KinematicCharacterController.KinematicCharacterMotor.Transform
get

The Transform of the character motor

◆ TransientPosition

Vector3 KinematicCharacterController.KinematicCharacterMotor.TransientPosition
get

The character's goal position in its movement calculations (always up-to-date during the character update phase)

◆ TransientRotation

Quaternion KinematicCharacterController.KinematicCharacterMotor.TransientRotation
get

The character's goal rotation in its movement calculations (always up-to-date during the character update phase)

◆ Velocity

Vector3 KinematicCharacterController.KinematicCharacterMotor.Velocity
get

The character's total velocity, including velocity from standing on rigidbodies or PhysicsMover


The documentation for this class was generated from the following file: