![]() |
Corgi Engine v9.3
|
The character controller that handles the character's gravity and collisions. It requires a Collider2D and a rigidbody to function. More...
Public Types | |
enum | UpdateModes { Update , FixedUpdate } |
the possible modes this controller can update on More... | |
enum | RaycastDirections { up , down , left , right } |
the possible directions a ray can be cast More... | |
enum | DetachmentMethods { Layer , Object , LayerChange } |
The possible ways a character can detach from a oneway or moving platform. More... | |
Public Member Functions | |
virtual float | Width () |
Returns the character's bounds width More... | |
virtual float | Height () |
Returns the character's bounds height More... | |
virtual void | AddForce (Vector2 force) |
Use this to add force to the character More... | |
virtual void | AddHorizontalForce (float x) |
use this to set the horizontal force applied to the character More... | |
virtual void | AddVerticalForce (float y) |
use this to set the vertical force applied to the character More... | |
virtual void | SetForce (Vector2 force) |
Use this to set the force applied to the character More... | |
virtual void | SetHorizontalForce (float x) |
use this to set the horizontal force applied to the character More... | |
virtual void | SetVerticalForce (float y) |
use this to set the vertical force applied to the character More... | |
virtual void | CachePlatformMask () |
A method you can use to cache the PlatformMask should you change it More... | |
virtual void | SetPusherPlatform (MMPathMovement newPusherPlatform) |
virtual void | DetachFromMovingPlatform () |
Disconnects the CorgiController from its current moving platform. More... | |
virtual bool | CastRays (RaycastDirections direction, float rayLength, Color color, ref RaycastHit2D[] storageArray) |
A public API to cast rays to any of the 4 cardinal directions using the built-in setup. You can specify the length and color of your rays, and pass a storageArray as a ref parameter, and then analyse its contents to do whatever you want. Note that in most situations (other than collision detection) this may be a bit overkill and maybe you should consider casting a single ray instead. It's up to you! Will return true if any of the rays hit something, false otherwise More... | |
virtual void | SetRaysParameters () |
Creates a rectangle with the boxcollider's size for ease of use and draws debug lines along the different raycast origin axis More... | |
virtual void | SetIgnoreCollider (Collider2D newIgnoredCollider) |
virtual IEnumerator | DisableCollisions (float duration) |
Disables the collisions for the specified duration More... | |
virtual void | CollisionsOn () |
Resets the collision mask with the default settings More... | |
virtual void | CollisionsOff () |
Turns all collisions off More... | |
virtual IEnumerator | DisableCollisionsWithOneWayPlatforms (float duration) |
Disables the collisions with one way platforms for the specified duration More... | |
virtual IEnumerator | DisableCollisionsWithMovingPlatforms (float duration) |
Disables the collisions with moving platforms for the specified duration More... | |
virtual void | CollisionsOffWithOneWayPlatformsLayer () |
Disables collisions only with the one way platform layers More... | |
virtual void | CollisionsOffWithMovingPlatformsLayer () |
Disables collisions only with moving platform layers More... | |
virtual void | CollisionsOnWithStairs () |
Enables collisions with the stairs layer More... | |
virtual void | CollisionsOffWithStairs () |
Disables collisions with the stairs layer More... | |
virtual void | ResetParameters () |
Resets all overridden parameters. More... | |
virtual void | SlowFall (float factor) |
Slows the character's fall by the specified factor. More... | |
virtual void | GravityActive (bool state) |
Activates or desactivates the gravity for this character only. More... | |
virtual void | ResizeCollider (Vector2 newSize) |
Resizes the collider to the new size set in parameters This is temporary - typically when crouching - and will be reverted by ResetColliderSize() More... | |
virtual void | ResizeColliderPermanently (Vector2 newSize) |
Resizes the collider to the new size set in parameters, won't be reverted by ResetColliderSize() More... | |
virtual void | ResetColliderSize () |
Returns the collider to its initial size More... | |
virtual bool | CanGoBackToOriginalSize () |
Determines whether this instance can go back to original size. More... | |
virtual bool | TrySetSafeTransformPosition (Vector3 position, bool moveToClosestPosition=false) |
Tries to move to a safe position, and moves to the closest position if specified. Returns true if movement was possible, false otherwise More... | |
virtual void | SetTransformPosition (Vector3 position) |
Moves the controller's transform to the desired position More... | |
virtual Vector2 | GetClosestSafePosition (Vector2 destination) |
Returns the closest "safe" point (not overlapping any platform) to the destination More... | |
virtual void | AnchorToGround () |
Teleports the character to the ground More... | |
Public Attributes | |
CorgiControllerParameters | DefaultParameters |
the initial parameters More... | |
LayerMask | PlatformMask = LayerManager.PlatformsLayerMask | LayerManager.PushablesLayerMask |
The layer mask the platforms are on. More... | |
LayerMask | MovingPlatformMask = LayerManager.MovingPlatformsLayerMask |
The layer mask the moving platforms are on. More... | |
LayerMask | OneWayPlatformMask = LayerManager.OneWayPlatformsLayerMask |
The layer mask the one way platforms are on. More... | |
LayerMask | MovingOneWayPlatformMask = LayerManager.MovingOneWayPlatformsMask |
The layer mask the moving one way platforms are on. More... | |
LayerMask | MidHeightOneWayPlatformMask = LayerManager.MidHeightOneWayPlatformsLayerMask |
The layer mask the mid height one way paltforms are on. More... | |
LayerMask | StairsMask = LayerManager.StairsLayerMask |
The layer mask the stairs are on. More... | |
DetachmentMethods | DetachmentMethod = DetachmentMethods.Layer |
When a character jumps from a oneway or moving platform, collisions are off for a short moment. You can decide if they should happen on a whole moving/1way platform layer basis or just with the object the character just left. More... | |
MMLayer | DetachmentLayer |
When using the LayerChange detachment method, this is the layer one way and moving platforms will be moved to temporarily. More... | |
GameObject | StandingOn |
gives you the object the character is standing on More... | |
UpdateModes | UpdateMode = UpdateModes.Update |
whether this controller should run on Update or FixedUpdate More... | |
int | NumberOfHorizontalRays = 8 |
the number of rays cast horizontally More... | |
int | NumberOfVerticalRays = 8 |
the number of rays cast vertically More... | |
float | RayOffsetHorizontal = 0.05f |
a small value added to all raycasts to accomodate for edge cases More... | |
float | RayOffsetVertical = 0.05f |
a small value added to all raycasts to accomodate for edge cases More... | |
float | RayExtraLengthHorizontal = 0f |
an extra length you an add when casting rays horizontally More... | |
float | RayExtraLengthVertical = 0f |
an extra length you an add when casting rays vertically More... | |
float | CrouchedRaycastLengthMultiplier = 1f |
by default, the length of the raycasts used to get back to normal size will be auto generated based on your character's normal/standing height, but here you can specify a different value More... | |
bool | CastRaysOnBothSides = false |
if this is true, rays will be cast on both sides, otherwise only in the current movement's direction. More... | |
float | DistanceToTheGroundRayMaximumLength = 100f |
the maximum length of the ray used to detect the distance to the ground More... | |
float | OnMovingPlatformRaycastLengthMultiplier = 2f |
a multiplier to apply to vertical downward raycasts while on a moving platform (longer == more stable movement on platforms) More... | |
float | ObstacleHeightTolerance = 0.05f |
an offset to apply vertically to the origin of the controller's raycasts that will have an impact on obstacle detection. Tweak this to adapt to your character's and obstacle's size. More... | |
bool | StickToSlopes = false |
If this is set to true, the character will stick to slopes when walking down them. More... | |
float | StickyRaycastLength = 0f |
The length of the raycasts used to stick to downward slopes. More... | |
float | StickToSlopesOffsetY = 0.2f |
the movement's Y offset to evaluate for stickiness. More... | |
float | TimeAirborne = 0f |
the time (in seconds) since the last time the character was grounded More... | |
bool | SafeSetTransform = false |
whether or not to perform additional checks when setting the transform's position (typically done by abilities like CharacterGrip). Slightly more expensive in terms of performance, but also safer. More... | |
bool | AutomaticallySetPhysicsSettings = true |
if this is true, this controller will set a number of physics settings automatically on init, to ensure they're correct More... | |
bool | AutomaticGravitySettings = true |
if this is true, gravity ability settings will be automatically set. It's recommended to set that to true. More... | |
bool | PerformSafetyBoxcast = false |
bool | SafetyBoxcastInAirOnly = true |
whether or not to only perform the safety boxcast check in the air More... | |
Vector2 | SafetyBoxcastSizeRatio = new Vector2(0.8f, 0.8f) |
the ratio to apply to the Character's size when boxcasting. You'll want it to be always smaller than the actual bounds. 0.8, or 0.5 are good default values in most contexts More... | |
float | ExtractionIncrement = 0.05f |
int | MaxExtractionsIterations = 10 |
The amount of times the controller should try to extract from a potential non safe space. More... | |
Protected Member Functions | |
virtual void | Awake () |
initialization More... | |
virtual void | Initialization () |
virtual void | ApplyPhysicsSettings () |
Forces a number of physics settings, if needed More... | |
virtual void | ApplyGravitySettings () |
Forces rotation if we don't have a gravity ability More... | |
virtual void | FixedUpdate () |
On FixedUpdate we run our routine if needed More... | |
virtual void | Update () |
On Update we run our routine if needed More... | |
virtual void | LateUpdate () |
On late update we reset our airborne time More... | |
virtual void | EveryFrame () |
Every frame, we apply the gravity to our character, then check using raycasts if an object's been hit, and modify its new position accordingly. When all the checks have been done, we apply that new position. More... | |
virtual void | FrameInitialization () |
virtual void | FrameExit () |
Called at the very last moment More... | |
virtual void | DetermineMovementDirection () |
Determines the current movement direction More... | |
virtual void | ApplyMovingPlatformMovementDirection (MMPathMovement movingPlatform) |
virtual void | MoveTransform () |
Moves the transform to its new position, after having performed an optional safety boxcast More... | |
virtual void | RunSafetyBoxcast () |
Returns true if a safety extraction is required, false otherwise More... | |
virtual void | ApplyGravity () |
Applies gravity to the current speed More... | |
virtual void | HandleMovingPlatforms (MMPathMovement movingPlatform, bool pushingPlatform=false) |
If the CorgiController is standing on a moving platform, we match its speed More... | |
virtual void | CastRaysToTheLeft () |
virtual void | CastRaysToTheRight () |
virtual void | CastRaysToTheSides (float raysDirection) |
Casts rays to the sides of the character, from its center axis. If we hit a wall/slope, we check its angle and move or not according to it. More... | |
virtual void | CastRaysBelow () |
Every frame, we cast a number of rays below our character to check for platform collisions More... | |
virtual void | CastRaysAbove () |
If we're in the air and moving up, we cast rays above the character's head to check for collisions More... | |
virtual void | StickToSlope () |
If we're going down a slope, sticks the character to the slope to avoid bounces More... | |
virtual void | ComputeNewSpeed () |
Computes the new speed of the character More... | |
virtual void | ClampSpeed () |
virtual void | ClampExternalForce () |
virtual void | SetStates () |
Sets grounded state and collision states More... | |
virtual void | ComputeDistanceToTheGround () |
Computes the distance to the ground More... | |
virtual void | OnCorgiColliderHit () |
triggered when the character's raycasts collide with something More... | |
virtual void | OnTriggerEnter2D (Collider2D collider) |
triggered when the character enters a collider More... | |
virtual void | OnTriggerStay2D (Collider2D collider) |
triggered while the character stays inside another collider More... | |
virtual void | OnTriggerExit2D (Collider2D collider) |
triggered when the character exits a collider More... | |
Static Protected Attributes | |
const float | _smallValue =0.0001f |
const float | _movingPlatformsGravity =-500 |
const float | _movementDirectionThreshold = 0.0001f |
Properties | |
CorgiControllerState | State [getprotected set] |
the various states of our character More... | |
CorgiControllerParameters?? | Parameters [get] |
the current parameters More... | |
GameObject | StandingOnLastFrame [getprotected set] |
the object the character was standing on last frame More... | |
Collider2D | StandingOnCollider [getprotected set] |
gives you the collider the character is standing on More... | |
GameObject | LastStandingOn [getprotected set] |
gives you the collider the character is standing on More... | |
Vector2 | Speed [get] |
the current speed of the character More... | |
virtual Vector2 | WorldSpeed [get] |
the world speed of the character More... | |
virtual Vector2 | ForcesApplied [getprotected set] |
the value of the forces applied at one point in time More... | |
virtual GameObject | CurrentWallCollider [getprotected set] |
the wall we're currently colliding with More... | |
Vector3 | ColliderSize [get] |
Vector2 | ColliderOffset [get] |
Vector3 | ColliderCenterPosition [get] |
virtual Vector3 | ColliderBottomPosition [get] |
virtual Vector3 | ColliderLeftPosition [get] |
virtual Vector3 | ColliderTopPosition [get] |
virtual Vector3 | ColliderRightPosition [get] |
bool | IsGravityActive [get] |
Is gravity active? More... | |
virtual float | DeltaTime [get] |
float | Friction [get] |
SurfaceModifier | CurrentSurfaceModifier [getset] |
GameObject[] | StandingOnArray [getset] |
virtual Vector2 | Bounds [get] |
virtual Vector3 | BoundsTopLeftCorner [get] |
virtual Vector3 | BoundsBottomLeftCorner [get] |
virtual Vector3 | BoundsTopRightCorner [get] |
virtual Vector3 | BoundsBottomRightCorner [get] |
virtual Vector3 | BoundsTop [get] |
virtual Vector3 | BoundsBottom [get] |
virtual Vector3 | BoundsRight [get] |
virtual Vector3 | BoundsLeft [get] |
virtual Vector3 | BoundsCenter [get] |
virtual float | DistanceToTheGround [get] |
virtual Vector2 | ExternalForce [get] |
The character controller that handles the character's gravity and collisions. It requires a Collider2D and a rigidbody to function.
|
virtual |
Use this to add force to the character
force | Force to add to the character. |
|
virtual |
use this to set the horizontal force applied to the character
x | The x value of the velocity. |
|
virtual |
use this to set the vertical force applied to the character
y | The y value of the velocity. |
|
virtual |
Teleports the character to the ground
|
protectedvirtual |
Applies gravity to the current speed
|
protectedvirtual |
Forces rotation if we don't have a gravity ability
|
protectedvirtual |
|
protectedvirtual |
Forces a number of physics settings, if needed
|
protectedvirtual |
initialization
|
virtual |
A method you can use to cache the PlatformMask should you change it
|
virtual |
Determines whether this instance can go back to original size.
true
if this instance can go back to original size; otherwise, false
.
|
virtual |
A public API to cast rays to any of the 4 cardinal directions using the built-in setup. You can specify the length and color of your rays, and pass a storageArray as a ref parameter, and then analyse its contents to do whatever you want. Note that in most situations (other than collision detection) this may be a bit overkill and maybe you should consider casting a single ray instead. It's up to you! Will return true if any of the rays hit something, false otherwise
true
, if one of the rays hit something, false
otherwise.direction | Direction. |
rayLength | Ray length. |
color | Color. |
storageArray | Storage array. |
|
protectedvirtual |
If we're in the air and moving up, we cast rays above the character's head to check for collisions
|
protectedvirtual |
Every frame, we cast a number of rays below our character to check for platform collisions
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
Casts rays to the sides of the character, from its center axis. If we hit a wall/slope, we check its angle and move or not according to it.
|
protectedvirtual |
|
protectedvirtual |
|
virtual |
Turns all collisions off
|
virtual |
Disables collisions only with moving platform layers
|
virtual |
Disables collisions only with the one way platform layers
|
virtual |
Disables collisions with the stairs layer
|
virtual |
Resets the collision mask with the default settings
|
virtual |
Enables collisions with the stairs layer
|
protectedvirtual |
Computes the distance to the ground
|
protectedvirtual |
Computes the new speed of the character
|
virtual |
Disconnects the CorgiController from its current moving platform.
|
protectedvirtual |
Determines the current movement direction
|
virtual |
Disables the collisions for the specified duration
duration | the duration for which the collisions must be disabled |
|
virtual |
Disables the collisions with moving platforms for the specified duration
duration | the duration for which the collisions must be disabled |
|
virtual |
Disables the collisions with one way platforms for the specified duration
duration | the duration for which the collisions must be disabled |
|
protectedvirtual |
Every frame, we apply the gravity to our character, then check using raycasts if an object's been hit, and modify its new position accordingly. When all the checks have been done, we apply that new position.
|
protectedvirtual |
On FixedUpdate we run our routine if needed
|
protectedvirtual |
Called at the very last moment
|
protectedvirtual |
|
virtual |
Returns the closest "safe" point (not overlapping any platform) to the destination
destination |
|
virtual |
Activates or desactivates the gravity for this character only.
state | If set to true , activates the gravity. If set to false , turns it off. |
|
protectedvirtual |
If the CorgiController is standing on a moving platform, we match its speed
|
virtual |
Returns the character's bounds height
|
protectedvirtual |
|
protectedvirtual |
On late update we reset our airborne time
|
protectedvirtual |
Moves the transform to its new position, after having performed an optional safety boxcast
|
protectedvirtual |
triggered when the character's raycasts collide with something
|
protectedvirtual |
triggered when the character enters a collider
collider | the object we're colliding with. |
|
protectedvirtual |
triggered when the character exits a collider
collider | the object we're colliding with. |
|
protectedvirtual |
triggered while the character stays inside another collider
collider | the object we're colliding with. |
|
virtual |
Returns the collider to its initial size
|
virtual |
Resets all overridden parameters.
|
virtual |
Resizes the collider to the new size set in parameters This is temporary - typically when crouching - and will be reverted by ResetColliderSize()
newSize | New size. |
|
virtual |
Resizes the collider to the new size set in parameters, won't be reverted by ResetColliderSize()
newSize |
|
protectedvirtual |
Returns true if a safety extraction is required, false otherwise
|
virtual |
Use this to set the force applied to the character
force | Force to apply to the character. |
|
virtual |
use this to set the horizontal force applied to the character
x | The x value of the velocity. |
|
virtual |
|
virtual |
|
virtual |
Creates a rectangle with the boxcollider's size for ease of use and draws debug lines along the different raycast origin axis
|
protectedvirtual |
Sets grounded state and collision states
|
virtual |
Moves the controller's transform to the desired position
position |
|
virtual |
use this to set the vertical force applied to the character
y | The y value of the velocity. |
|
virtual |
Slows the character's fall by the specified factor.
factor | Factor. |
|
protectedvirtual |
If we're going down a slope, sticks the character to the slope to avoid bounces
|
virtual |
Tries to move to a safe position, and moves to the closest position if specified. Returns true if movement was possible, false otherwise
position | |
moveToClosestPosition |
|
protectedvirtual |
On Update we run our routine if needed
|
virtual |
Returns the character's bounds width
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
staticprotected |
|
protected |
|
protected |
|
staticprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
staticprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
bool MoreMountains.CorgiEngine.CorgiController.AutomaticallySetPhysicsSettings = true |
if this is true, this controller will set a number of physics settings automatically on init, to ensure they're correct
bool MoreMountains.CorgiEngine.CorgiController.AutomaticGravitySettings = true |
if this is true, gravity ability settings will be automatically set. It's recommended to set that to true.
bool MoreMountains.CorgiEngine.CorgiController.CastRaysOnBothSides = false |
if this is true, rays will be cast on both sides, otherwise only in the current movement's direction.
float MoreMountains.CorgiEngine.CorgiController.CrouchedRaycastLengthMultiplier = 1f |
by default, the length of the raycasts used to get back to normal size will be auto generated based on your character's normal/standing height, but here you can specify a different value
CorgiControllerParameters MoreMountains.CorgiEngine.CorgiController.DefaultParameters |
the initial parameters
MMLayer MoreMountains.CorgiEngine.CorgiController.DetachmentLayer |
When using the LayerChange detachment method, this is the layer one way and moving platforms will be moved to temporarily.
DetachmentMethods MoreMountains.CorgiEngine.CorgiController.DetachmentMethod = DetachmentMethods.Layer |
When a character jumps from a oneway or moving platform, collisions are off for a short moment. You can decide if they should happen on a whole moving/1way platform layer basis or just with the object the character just left.
float MoreMountains.CorgiEngine.CorgiController.DistanceToTheGroundRayMaximumLength = 100f |
the maximum length of the ray used to detect the distance to the ground
float MoreMountains.CorgiEngine.CorgiController.ExtractionIncrement = 0.05f |
if an obstacle is found, extraction will be attempted, and the controller will move back along its last movement line, trying to find a safe space to put the character. This defines the distance of each of these moves. Keep it small, and consistent with your character's size and speed
int MoreMountains.CorgiEngine.CorgiController.MaxExtractionsIterations = 10 |
The amount of times the controller should try to extract from a potential non safe space.
LayerMask MoreMountains.CorgiEngine.CorgiController.MidHeightOneWayPlatformMask = LayerManager.MidHeightOneWayPlatformsLayerMask |
The layer mask the mid height one way paltforms are on.
LayerMask MoreMountains.CorgiEngine.CorgiController.MovingOneWayPlatformMask = LayerManager.MovingOneWayPlatformsMask |
The layer mask the moving one way platforms are on.
LayerMask MoreMountains.CorgiEngine.CorgiController.MovingPlatformMask = LayerManager.MovingPlatformsLayerMask |
The layer mask the moving platforms are on.
int MoreMountains.CorgiEngine.CorgiController.NumberOfHorizontalRays = 8 |
the number of rays cast horizontally
int MoreMountains.CorgiEngine.CorgiController.NumberOfVerticalRays = 8 |
the number of rays cast vertically
float MoreMountains.CorgiEngine.CorgiController.ObstacleHeightTolerance = 0.05f |
an offset to apply vertically to the origin of the controller's raycasts that will have an impact on obstacle detection. Tweak this to adapt to your character's and obstacle's size.
LayerMask MoreMountains.CorgiEngine.CorgiController.OneWayPlatformMask = LayerManager.OneWayPlatformsLayerMask |
The layer mask the one way platforms are on.
float MoreMountains.CorgiEngine.CorgiController.OnMovingPlatformRaycastLengthMultiplier = 2f |
a multiplier to apply to vertical downward raycasts while on a moving platform (longer == more stable movement on platforms)
bool MoreMountains.CorgiEngine.CorgiController.PerformSafetyBoxcast = false |
if this is true, the controller will perform an extra boxcast before authorizing movement, from the previous place to the next. If an obstacle is found between the two, movement will be prevented, and extraction will be attempted In most contexts this can remain false, but if you experience characters going through platforms, turn it on
LayerMask MoreMountains.CorgiEngine.CorgiController.PlatformMask = LayerManager.PlatformsLayerMask | LayerManager.PushablesLayerMask |
The layer mask the platforms are on.
float MoreMountains.CorgiEngine.CorgiController.RayExtraLengthHorizontal = 0f |
an extra length you an add when casting rays horizontally
float MoreMountains.CorgiEngine.CorgiController.RayExtraLengthVertical = 0f |
an extra length you an add when casting rays vertically
float MoreMountains.CorgiEngine.CorgiController.RayOffsetHorizontal = 0.05f |
a small value added to all raycasts to accomodate for edge cases
float MoreMountains.CorgiEngine.CorgiController.RayOffsetVertical = 0.05f |
a small value added to all raycasts to accomodate for edge cases
bool MoreMountains.CorgiEngine.CorgiController.SafeSetTransform = false |
whether or not to perform additional checks when setting the transform's position (typically done by abilities like CharacterGrip). Slightly more expensive in terms of performance, but also safer.
bool MoreMountains.CorgiEngine.CorgiController.SafetyBoxcastInAirOnly = true |
whether or not to only perform the safety boxcast check in the air
Vector2 MoreMountains.CorgiEngine.CorgiController.SafetyBoxcastSizeRatio = new Vector2(0.8f, 0.8f) |
the ratio to apply to the Character's size when boxcasting. You'll want it to be always smaller than the actual bounds. 0.8, or 0.5 are good default values in most contexts
LayerMask MoreMountains.CorgiEngine.CorgiController.StairsMask = LayerManager.StairsLayerMask |
The layer mask the stairs are on.
GameObject MoreMountains.CorgiEngine.CorgiController.StandingOn |
gives you the object the character is standing on
bool MoreMountains.CorgiEngine.CorgiController.StickToSlopes = false |
If this is set to true, the character will stick to slopes when walking down them.
float MoreMountains.CorgiEngine.CorgiController.StickToSlopesOffsetY = 0.2f |
the movement's Y offset to evaluate for stickiness.
float MoreMountains.CorgiEngine.CorgiController.StickyRaycastLength = 0f |
The length of the raycasts used to stick to downward slopes.
float MoreMountains.CorgiEngine.CorgiController.TimeAirborne = 0f |
the time (in seconds) since the last time the character was grounded
UpdateModes MoreMountains.CorgiEngine.CorgiController.UpdateMode = UpdateModes.Update |
whether this controller should run on Update or FixedUpdate
|
get |
|
get |
|
get |
|
get |
|
get |
|
get |
|
get |
|
get |
|
get |
|
get |
|
get |
|
get |
|
get |
|
get |
|
get |
|
get |
|
get |
|
getset |
|
getprotected set |
the wall we're currently colliding with
|
get |
|
get |
|
get |
|
getprotected set |
the value of the forces applied at one point in time
|
get |
|
get |
Is gravity active?
|
getprotected set |
gives you the collider the character is standing on
|
get |
the current parameters
|
get |
the current speed of the character
|
getset |
|
getprotected set |
gives you the collider the character is standing on
|
getprotected set |
the object the character was standing on last frame
|
getprotected set |
the various states of our character
|
get |
the world speed of the character