Struct BasicStepAndSlopeHandlingParameters
Contains a set of parameters related to step and slope handling behaviour for a character
Inherited Members
Namespace: Unity.CharacterController
Syntax
[Serializable]
public struct BasicStepAndSlopeHandlingParameters
Fields
CharacterWidthForStepGroundingCheck
Character width used to determine grounding for steps. For a capsule this should be 2x capsule radius, and for a box it should be maximum box width. This is for cases where character with a spherical base tries to step onto an angled surface that is near the character's max step height. In thoses cases, the character might be grounded on steps on one frame, but wouldn't be grounded on the next frame as the spherical nature of its shape would push it a bit further up beyond its max step height.
Declaration
[Tooltip("Character width used to determine grounding for steps. For a capsule this should be 2x capsule radius, and for a box it should be maximum box width. This is for cases where character with a spherical base tries to step onto an angled surface that is near the character's max step height. In thoses cases, the character might be grounded on steps on one frame, but wouldn't be grounded on the next frame as the spherical nature of its shape would push it a bit further up beyond its max step height.")]
public float CharacterWidthForStepGroundingCheck
Field Value
Type | Description |
---|---|
Single |
ConstrainVelocityToGroundPlane
Whether or not to constrain the character velocity to ground plane when it hits a non-grounded slope
Declaration
[Header("Misc")]
[Tooltip("Whether or not to constrain the character velocity to ground plane when it hits a non-grounded slope")]
public bool ConstrainVelocityToGroundPlane
Field Value
Type | Description |
---|---|
Boolean |
ExtraStepChecksDistance
Horizontal offset distance of extra downwards raycasts used to detect grounding around a step
Declaration
[Tooltip("Horizontal offset distance of extra downwards raycasts used to detect grounding around a step")]
public float ExtraStepChecksDistance
Field Value
Type | Description |
---|---|
Single |
HasMaxDownwardSlopeChangeAngle
Whether or not the character has a max slope change that it can stay grounded on
Declaration
[Tooltip("Whether or not the character has a max slope change that it can stay grounded on")]
public bool HasMaxDownwardSlopeChangeAngle
Field Value
Type | Description |
---|---|
Boolean |
MaxDownwardSlopeChangeAngle
Max slope change that the character can stay grounded on
Declaration
[Tooltip("Max slope change that the character can stay grounded on (degrees)")]
[Range(0F, 180F)]
public float MaxDownwardSlopeChangeAngle
Field Value
Type | Description |
---|---|
Single |
MaxStepHeight
Max height that the character can step on
Declaration
[Tooltip("Max height that the character can step on")]
public float MaxStepHeight
Field Value
Type | Description |
---|---|
Single |
PreventGroundingWhenMovingTowardsNoGrounding
Whether or not to cancel grounding when the character is moving off a ledge. This prevents the character from "snapping" onto the ledge as it moves off of it
Declaration
[Header("Slope Changes")]
[Tooltip("Whether or not to cancel grounding when the character is moving off a ledge. This prevents the character from \"snapping\" onto the ledge as it moves off of it")]
public bool PreventGroundingWhenMovingTowardsNoGrounding
Field Value
Type | Description |
---|---|
Boolean |
StepHandling
Whether or not step handling logic is enabled
Declaration
[Header("Step Handling")]
[Tooltip("Whether or not step handling logic is enabled")]
public bool StepHandling
Field Value
Type | Description |
---|---|
Boolean |
Methods
GetDefault()
Gets a default initialized version of step and slope handling parameters
Declaration
public static BasicStepAndSlopeHandlingParameters GetDefault()
Returns
Type | Description |
---|---|
BasicStepAndSlopeHandlingParameters | Default parameters struct |