Property | Type | Description | |
---|---|---|---|
enableSlopes | bool | ||
maxClimbAngle | float | ||
maxDescendAngle | float | ||
minTranslation | float | ||
onLanding | System.Action | ||
onLeaveGround | System.Action | ||
onLeftWall | System.Action | ||
onRightWall | System.Action | ||
onTop | System.Action | ||
wallAngle | float |
Method | Description | |
---|---|---|
ClimbSlope ( Vector3 &velocity ) : void |
Modify velocity to smooth climb current slope
|
|
ConsolidateCollisions ( ) : void |
After all work, notify changes
|
|
DescendSlope ( Vector3 &velocity ) : void |
Modify velocity to smooth descend current slope
|
|
DiagonalCollisions ( Vector3 &velocity ) : void |
Unused. This may be redundant still experimental to fix some edge cases...
|
|
DisableLeaveGround ( ) : void |
same as: 'leavingGround=false' to be used with: UpdateManager.SetTimeout
|
|
DisableSlopes ( float resetDelay = 0.5f ) : void |
Disable slopes, so no more ClimbSlope/DescendSlope This is important, because while on slope, velocity.y will be modified If you need your velocity to remain, you must disable slopes.\n NOTE use it for jumping over a slope
|
|
EnableLeaveGround ( float resetDelay = 0.5f ) : void |
leavingGround = true during resetDelay time
|
|
EnableSlopes ( ) : void |
same as: 'enableSlopes=true' to be used with: UpdateManager.SetTimeout
|
|
FallThroughPlatform ( float resetDelay = 0.5f ) : void |
fallingThroughPlatform = true during resetDelay time
|
|
GetDownSlopeDir ( ) : Vector3 |
Vector pointing were to descend / slip
|
|
HorizontalCollisions ( |
Callback for ForeachLeftRay/ForeachRightRay
|
|
IsOnGround ( int graceFrames ) : bool |
Collider is/was on ground. This is useful to give player some help, no pixel precision jumps :)
|
|
Move ( Vector3 velocity, float delta ) : Vector3 |
Attempt to move the character to current position + velocity. Any colliders in our way will cause velocity to be modified ex: wall -> stop. slope -> modifiy velocity.\n NOTE collisions.velocity has the real velocity applied
|
|
OnEnable ( ) : void | ||
ResetFallingThroughPlatform ( ) : void |
same as: 'fallingThroughPlatform=false' to be used with: UpdateManager.SetTimeout
|
|
Start ( ) : void | ||
UpdateCurrentSlope ( Vector3 velocity ) : void |
Launch rays and get the maximum slope found
|
|
VerticalCollisions ( |
Callback for ForeachHeadRay/ForeachFeetRay
|
public ClimbSlope ( Vector3 &velocity ) : void | ||
velocity | Vector3 | Amount to be moved |
return | void |
public DescendSlope ( Vector3 &velocity ) : void | ||
velocity | Vector3 | Amount to be moved |
return | void |
public DiagonalCollisions ( Vector3 &velocity ) : void | ||
velocity | Vector3 | Amount to be moved |
return | void |
public DisableSlopes ( float resetDelay = 0.5f ) : void | ||
resetDelay | float | 0 means no reset |
return | void |
public EnableLeaveGround ( float resetDelay = 0.5f ) : void | ||
resetDelay | float | 0 means no reset |
return | void |
public FallThroughPlatform ( float resetDelay = 0.5f ) : void | ||
resetDelay | float | 0 means no reset |
return | void |
public HorizontalCollisions ( |
||
ray | result of Raycast horizontally | |
velocity | Vector3 | Amount to be moved |
dir | int | Direction |
idx | int | ray index |
return | void |
public IsOnGround ( int graceFrames ) : bool | ||
graceFrames | int | 0 means current frame |
return | bool |
public Move ( Vector3 velocity, float delta ) : Vector3 | ||
velocity | Vector3 | Amount to be moved (velocity * delta) |
delta | float | Time since last update |
return | Vector3 |
public ResetFallingThroughPlatform ( ) : void | ||
return | void |
public UpdateCurrentSlope ( Vector3 velocity ) : void | ||
velocity | Vector3 | Amount to be moved |
return | void |
public VerticalCollisions ( |
||
ray | result of Raycast vertically | |
velocity | Vector3 | Amount to be moved |
dir | int | Direction |
idx | int | ray index |
return | void |