2D Platform Controller  v1.7.0
Autogenerated code documentation for the 2D Platform Controller.
 All Classes Functions Variables Properties
CrouchDetails Class Reference

Crouch details. Control what happens when you press down. More...

Public Attributes

bool canCrouch = true
 Can character crouch. More...
 
bool canCrouchSlide = true
 Can character slide along in a crouch position. More...
 
bool canCrouchJump = false
 If true the character can maintain a crouch position while jumping. More...
 
float minVelocityForSlide = 3.0f
 How fast character needs to be moving in the x direction before a crouch slide is initiated. More...
 
float minVelocityForStopSlide = 1.75f
 Once crouch sliding how slow does the character need to be going for the slide to stop. More...
 
float slideDrag = 0.6f
 How much drag is applied when crouch sliding. More...
 
bool useHeightReduction
 If true we will automatically shrink the characters head colliders by the the height reduction factor. The alternative is to attach the head colliders to transforms, or listen for events and handle it compeltely in your own code. More...
 
float heightReductionFactor = 2f
 If use heightRecution = true then this is amount the characters head colliders will be reduced by. Specifically the head collider distance is scaled by this factor and then the offset downwards by (0.5f * new distance) More...
 
float ignoredSideCollidersHigherThan = 0f
 If use heightRecution = true then any side collider higher (determined by its yOffset only) than this value will be ignored while crouching. More...
 
float headDetectionDistance
 If you are not usinng the automatic height recution (i.e. heightReduction = false), then this value will be added to your head collider distance when determining if character is able to stand up. This is used to prevent the character standing up while sliding under a platform. More...
 

Detailed Description

Crouch details. Control what happens when you press down.

Member Data Documentation

bool CrouchDetails.canCrouch = true

Can character crouch.

bool CrouchDetails.canCrouchJump = false

If true the character can maintain a crouch position while jumping.

bool CrouchDetails.canCrouchSlide = true

Can character slide along in a crouch position.

float CrouchDetails.headDetectionDistance

If you are not usinng the automatic height recution (i.e. heightReduction = false), then this value will be added to your head collider distance when determining if character is able to stand up. This is used to prevent the character standing up while sliding under a platform.

float CrouchDetails.heightReductionFactor = 2f

If use heightRecution = true then this is amount the characters head colliders will be reduced by. Specifically the head collider distance is scaled by this factor and then the offset downwards by (0.5f * new distance)

float CrouchDetails.ignoredSideCollidersHigherThan = 0f

If use heightRecution = true then any side collider higher (determined by its yOffset only) than this value will be ignored while crouching.

float CrouchDetails.minVelocityForSlide = 3.0f

How fast character needs to be moving in the x direction before a crouch slide is initiated.

float CrouchDetails.minVelocityForStopSlide = 1.75f

Once crouch sliding how slow does the character need to be going for the slide to stop.

float CrouchDetails.slideDrag = 0.6f

How much drag is applied when crouch sliding.

bool CrouchDetails.useHeightReduction

If true we will automatically shrink the characters head colliders by the the height reduction factor. The alternative is to attach the head colliders to transforms, or listen for events and handle it compeltely in your own code.


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