TopDown Engine  v3.6
MoreMountains.TopDownEngine.TopDownController3D Class Reference

A controller, initially adapted from Unity's CharacterMotor.js, to add on top of Unity's native CharacterController, that will handle More...

Inheritance diagram for MoreMountains.TopDownEngine.TopDownController3D:
MoreMountains.TopDownEngine.TopDownController MoreMountains.TopDownEngine.TopDownMonoBehaviour MoreMountains.Tools.MMMonoBehaviour

Public Types

enum  GroundedComputationModes { GroundedComputationModes.Simple, GroundedComputationModes.Advanced }
 the possible modes to compute grounded state. Simple should only be used if your ground is even and flat More...
 
enum  UpdateModes { UpdateModes.Update, UpdateModes.FixedUpdate }
 the different possible update modes More...
 
enum  VelocityTransferOnJump { VelocityTransferOnJump.NoTransfer, VelocityTransferOnJump.InitialVelocity, VelocityTransferOnJump.FloorVelocity, VelocityTransferOnJump.Relative }
 the possible ways to transfer velocity on jump More...
 

Public Member Functions

virtual bool IsSliding ()
 whether or not the character is sliding down a steep slope More...
 
virtual bool CollidingAbove ()
 whether or not the character is colliding above More...
 
virtual bool TooSteep ()
 whether or not the current surface is too steep or not More...
 
virtual void DetachFromGround ()
 Forces the controller to detach from the ground More...
 
virtual void DetachFromMovingPlatform ()
 
override bool CanGoBackToOriginalSize ()
 Determines whether this instance can go back to original size. More...
 
override void ResizeColliderHeight (float newHeight, bool translateCenter=false)
 Resizes the collider to the new size set in parameters More...
 
override void ResetColliderSize ()
 Returns the collider to its initial size More...
 
virtual bool IsGroundedTest ()
 Whether or not the character is grounded More...
 
override void CollisionsOn ()
 Enables the collider More...
 
override void CollisionsOff ()
 Disables collider More...
 
override void DetectObstacles (float distance, Vector3 offset)
 Performs a cardinal collision check and stores collision objects informations More...
 
override void AddForce (Vector3 movement)
 Adds a force of the specified direction and magnitude to the character More...
 
override void Impact (Vector3 direction, float force)
 Applies an impact to the character of the specified direction and force More...
 
override void SetMovement (Vector3 movement)
 Sets the character's current input direction and magnitude More...
 
override void SetKinematic (bool state)
 Turns this character's rigidbody kinematic or not More...
 
override void MovePosition (Vector3 newPosition)
 Moves this character to the specified position while trying to avoid obstacles More...
 
override void Reset ()
 On reset, we reset vectors and transforms More...
 
- Public Member Functions inherited from MoreMountains.TopDownEngine.TopDownController
virtual void SetGravityActive (bool status)
 Sets gravity active or inactive More...
 

Public Attributes

Vector3 InputMoveDirection = Vector3.zero
 the current input sent to this character More...
 
UpdateModes UpdateMode = UpdateModes.FixedUpdate
 whether the movement computation should occur at Update or FixedUpdate. FixedUpdate is the recommended choice. More...
 
VelocityTransferOnJump VelocityTransferMethod = VelocityTransferOnJump.FloorVelocity
 how the velocity should be affected when jumping from a moving ground More...
 
LayerMask ObstaclesLayerMask = LayerManager.ObstaclesLayerMask
 the layer to consider as obstacles (will prevent movement) More...
 
float GroundedRaycastLength = 5f
 the length of the raycasts to cast downwards More...
 
float MinimumGroundedDistance = 0.2f
 the distance to the ground beyond which the character isn't considered grounded anymore More...
 
GroundedComputationModes GroundedComputationMode = GroundedComputationModes.Advanced
 the selected modes to compute grounded state. Simple should only be used if your ground is even and flat More...
 
float GroundNormalHeightThreshold = 0.2f
 a threshold against which to check when going over steps. Adjust that value if your character has issues going over small steps More...
 
float ImpactFalloff = 5f
 the speed at which external forces get lerped to zero More...
 
float MaximumFallSpeed = 20.0f
 the maximum vertical velocity the character can have while falling More...
 
AnimationCurve SlopeSpeedMultiplier = new AnimationCurve(new Keyframe(-90, 1), new Keyframe(0, 1), new Keyframe(90, 0))
 the factor by which to multiply the speed while walking on a slope. x is the angle, y is the factor More...
 
Vector3 GroundNormal = Vector3.zero
 the current surface normal vector More...
 
bool SlideOnSteepSurfaces = true
 whether or not the character should slide while standing on steep surfaces More...
 
float SlidingSpeed = 15f
 the speed at which the character should slide More...
 
float SlidingSpeedControl = 0.4f
 the control the player has on the speed while sliding down More...
 
float SlidingDirectionControl = 1f
 the control the player has on the direction while sliding down More...
 
- Public Attributes inherited from MoreMountains.TopDownEngine.TopDownController
float Gravity = 40f
 the current gravity to apply to our character (positive goes down, negative goes up, higher value, higher acceleration) More...
 
bool GravityActive = true
 whether or not the gravity is currently being applied to this character 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 PerformCardinalObstacleRaycastDetection = false
 if this is true, extra raycasts will be cast on all 4 sides to detect obstacles and feed the CollidingWithCardinalObstacle bool, only useful when working with grid movement, or if you need that info for some reason More...
 
Vector3 Speed
 the current speed of the character More...
 
Vector3 Velocity
 the current velocity More...
 
Vector3 VelocityLastFrame
 the velocity of the character last frame More...
 
Vector3 Acceleration
 the current acceleration More...
 
bool Grounded
 whether or not the character is grounded More...
 
bool JustGotGrounded
 whether or not the character got grounded this frame More...
 
Vector3 CurrentMovement
 the current movement of the character More...
 
Vector3 CurrentDirection
 the direction the character is going in More...
 
float Friction
 the current friction More...
 
Vector3 AddedForce
 the current added force, to be added to the character's movement More...
 
bool FreeMovement = true
 whether or not the character is in free movement mode or not More...
 

Protected Member Functions

override void Awake ()
 On awake we store our various components for future use More...
 
override void LateUpdate ()
 On late update we apply any impact we have in store, and store our velocity for use next frame More...
 
override void Update ()
 On Update we process our Update computations if UpdateMode is set to Update More...
 
override void FixedUpdate ()
 On FixedUpdate we process our Update computations if UpdateMode is set to FixedUpdate More...
 
virtual void ProcessUpdate ()
 Computes the new velocity and moves the character More...
 
virtual void AddInput ()
 Determines the new velocity based on the slope we're on and the input More...
 
virtual void AddGravity ()
 Adds the gravity to the new velocity and any AddedForce we may have More...
 
virtual void MoveWithPlatform ()
 Moves and rotates the character controller to follow any moving platform we may be standing on More...
 
virtual void ComputeVelocityDelta ()
 Computes the motion vector to apply to the character controller More...
 
virtual void MoveCharacterController ()
 Moves the character controller by the computed _motion More...
 
virtual void DetectNewMovingPlatform ()
 Detects any moving platform we may be standing on More...
 
virtual void ComputeNewVelocity ()
 Determines the new Velocity value based on our position and our position last frame More...
 
virtual void HandleGroundContact ()
 We handle ground contact, velocity transfer and moving platforms More...
 
override void DetermineDirection ()
 Determines the direction based on the current movement More...
 
override void HandleFriction ()
 Handles friction with ground surfaces, coming soon More...
 
virtual void ManualControllerColliderHit ()
 This method compensates for the regular OnControllerColliderHit, which unfortunately generates a lot of garbage. To do so, it casts a ray downwards to get our ground normal, and a ray in the current movement direction to (potentially) push rigidbodies More...
 
virtual void HandleAdvancedGroundDetection ()
 
virtual void CastRayDownwards ()
 Casts a ray downwards and adjusts distances if needed More...
 
float AdjustDistance (float distance)
 Returns the real distance between the extremity of the character and the ground More...
 
virtual void OnTriggerEnter (Collider other)
 When triggering with something else, we check if it's a moving platform and we push ourselves if needed More...
 
virtual void GetMovingPlatformVelocity ()
 Gets the current moving platform's velocity More...
 
virtual IEnumerator SubstractNewPlatformVelocity ()
 Computes the relative velocity More...
 
virtual bool ShouldMoveWithPlatformThisFrame ()
 Whether or not our character should move with the moving platform this frame More...
 
override void CheckIfGrounded ()
 Grounded check More...
 
virtual void ApplyImpact ()
 Applies the stored impact to the character More...
 
- Protected Member Functions inherited from MoreMountains.TopDownEngine.TopDownController
virtual void ComputeSpeed ()
 Computes the speed More...
 

Protected Attributes

Transform _transform
 
Rigidbody _rigidBody
 
Collider _collider
 
CharacterController _characterController
 
float _originalColliderHeight
 
Vector3 _originalColliderCenter
 
Vector3 _originalSizeRaycastOrigin
 
Vector3 _lastGroundNormal = Vector3.zero
 
WaitForFixedUpdate _waitForFixedUpdate = new WaitForFixedUpdate()
 
bool _detached = false
 
Transform _movingPlatformHitCollider
 
Transform _movingPlatformCurrentHitCollider
 
Vector3 _movingPlatformCurrentHitColliderLocal
 
Vector3 _movingPlatformCurrentGlobalPoint
 
Quaternion _movingPlatformLocalRotation
 
Quaternion _movingPlatformGlobalRotation
 
Matrix4x4 _lastMovingPlatformMatrix
 
Vector3 _movingPlatformVelocity
 
bool _newMovingPlatform
 
CollisionFlags _collisionFlags
 
Vector3 _frameVelocity = Vector3.zero
 
Vector3 _hitPoint = Vector3.zero
 
Vector3 _lastHitPoint = new Vector3(Mathf.Infinity, 0, 0)
 
Vector3 _newVelocity
 
Vector3 _lastHorizontalVelocity
 
Vector3 _newHorizontalVelocity
 
Vector3 _motion
 
Vector3 _idealVelocity
 
Vector3 _idealDirection
 
Vector3 _horizontalVelocityDelta
 
float _stickyOffset = 0f
 
RaycastHit _movePositionHit
 
Vector3 _capsulePoint1
 
Vector3 _capsulePoint2
 
Vector3 _movePositionDirection
 
float _movePositionDistance
 
RaycastHit _cardinalRaycast
 
float _smallestDistance = Single.MaxValue
 
float _longestDistance = Single.MinValue
 
RaycastHit _smallestRaycast
 
RaycastHit _emptyRaycast = new RaycastHit()
 
Vector3 _downRaycastsOffset
 
Vector3 _moveWithPlatformMoveDistance
 
Vector3 _moveWithPlatformGlobalPoint
 
Quaternion _moveWithPlatformGlobalRotation
 
Quaternion _moveWithPlatformRotationDiff
 
RaycastHit _raycastDownHit
 
Vector3 _raycastDownDirection = Vector3.down
 
RaycastHit _canGoBackHeadCheck
 
bool _tooSteepLastFrame
 
Vector3 _onTriggerEnterPushbackDirection
 
- Protected Attributes inherited from MoreMountains.TopDownEngine.TopDownController
Vector3 _positionLastFrame
 
Vector3 _speedComputation
 
bool _groundedLastFrame
 
Vector3 _impact
 

Properties

override Vector3 ColliderCenter [get]
 returns the center coordinate of the collider More...
 
override Vector3 ColliderBottom [get]
 returns the bottom coordinate of the collider More...
 
override Vector3 ColliderTop [get]
 returns the top coordinate of the collider More...
 
virtual bool ExitedTooSteepSlopeThisFrame [get, set]
 whether or not the character just entered a slope/ground not too steep this frame More...
 
override bool OnAMovingPlatform [get]
 whether or not the character is on a moving platform More...
 
override Vector3 MovingPlatformSpeed [get]
 the speed of the moving platform More...
 
- Properties inherited from MoreMountains.TopDownEngine.TopDownController
virtual Vector3 ColliderCenter [get]
 the collider's center coordinates More...
 
virtual Vector3 ColliderBottom [get]
 the collider's bottom coordinates More...
 
virtual Vector3 ColliderTop [get]
 the collider's top coordinates More...
 
virtual GameObject ObjectBelow [get, set]
 the object (if any) below our character More...
 
virtual SurfaceModifier SurfaceModifierBelow [get, set]
 the surface modifier object below our character (if any) More...
 
virtual Vector3 AppliedImpact [get]
 
virtual bool OnAMovingPlatform [get, set]
 whether or not the character is on a moving platform More...
 
virtual Vector3 MovingPlatformSpeed [get, set]
 the speed of the moving platform More...
 
virtual GameObject DetectedObstacleLeft [get, set]
 
virtual GameObject DetectedObstacleRight [get, set]
 
virtual GameObject DetectedObstacleUp [get, set]
 
virtual GameObject DetectedObstacleDown [get, set]
 
virtual bool CollidingWithCardinalObstacle [get, set]
 

Additional Inherited Members

- Static Protected Attributes inherited from MoreMountains.TopDownEngine.TopDownController
const float _smallValue =0.0001f
 

Detailed Description

A controller, initially adapted from Unity's CharacterMotor.js, to add on top of Unity's native CharacterController, that will handle

Member Enumeration Documentation

◆ GroundedComputationModes

the possible modes to compute grounded state. Simple should only be used if your ground is even and flat

Enumerator
Simple 
Advanced 

◆ UpdateModes

the different possible update modes

Enumerator
Update 
FixedUpdate 

◆ VelocityTransferOnJump

the possible ways to transfer velocity on jump

Enumerator
NoTransfer 
InitialVelocity 
FloorVelocity 
Relative 

Member Function Documentation

◆ AddForce()

override void MoreMountains.TopDownEngine.TopDownController3D.AddForce ( Vector3  movement)
virtual

Adds a force of the specified direction and magnitude to the character

Parameters
movement

Reimplemented from MoreMountains.TopDownEngine.TopDownController.

◆ AddGravity()

virtual void MoreMountains.TopDownEngine.TopDownController3D.AddGravity ( )
protectedvirtual

Adds the gravity to the new velocity and any AddedForce we may have

◆ AddInput()

virtual void MoreMountains.TopDownEngine.TopDownController3D.AddInput ( )
protectedvirtual

Determines the new velocity based on the slope we're on and the input

◆ AdjustDistance()

float MoreMountains.TopDownEngine.TopDownController3D.AdjustDistance ( float  distance)
protected

Returns the real distance between the extremity of the character and the ground

Parameters
distance
Returns

◆ ApplyImpact()

virtual void MoreMountains.TopDownEngine.TopDownController3D.ApplyImpact ( )
protectedvirtual

Applies the stored impact to the character

◆ Awake()

override void MoreMountains.TopDownEngine.TopDownController3D.Awake ( )
protectedvirtual

On awake we store our various components for future use

Reimplemented from MoreMountains.TopDownEngine.TopDownController.

◆ CanGoBackToOriginalSize()

override bool MoreMountains.TopDownEngine.TopDownController3D.CanGoBackToOriginalSize ( )
virtual

Determines whether this instance can go back to original size.

Returns
true if this instance can go back to original size; otherwise, false.

Reimplemented from MoreMountains.TopDownEngine.TopDownController.

◆ CastRayDownwards()

virtual void MoreMountains.TopDownEngine.TopDownController3D.CastRayDownwards ( )
protectedvirtual

Casts a ray downwards and adjusts distances if needed

◆ CheckIfGrounded()

override void MoreMountains.TopDownEngine.TopDownController3D.CheckIfGrounded ( )
protectedvirtual

Grounded check

Reimplemented from MoreMountains.TopDownEngine.TopDownController.

◆ CollidingAbove()

virtual bool MoreMountains.TopDownEngine.TopDownController3D.CollidingAbove ( )
virtual

whether or not the character is colliding above

◆ CollisionsOff()

override void MoreMountains.TopDownEngine.TopDownController3D.CollisionsOff ( )
virtual

Disables collider

Reimplemented from MoreMountains.TopDownEngine.TopDownController.

◆ CollisionsOn()

override void MoreMountains.TopDownEngine.TopDownController3D.CollisionsOn ( )
virtual

Enables the collider

Reimplemented from MoreMountains.TopDownEngine.TopDownController.

◆ ComputeNewVelocity()

virtual void MoreMountains.TopDownEngine.TopDownController3D.ComputeNewVelocity ( )
protectedvirtual

Determines the new Velocity value based on our position and our position last frame

◆ ComputeVelocityDelta()

virtual void MoreMountains.TopDownEngine.TopDownController3D.ComputeVelocityDelta ( )
protectedvirtual

Computes the motion vector to apply to the character controller

◆ DetachFromGround()

virtual void MoreMountains.TopDownEngine.TopDownController3D.DetachFromGround ( )
virtual

Forces the controller to detach from the ground

◆ DetachFromMovingPlatform()

virtual void MoreMountains.TopDownEngine.TopDownController3D.DetachFromMovingPlatform ( )
virtual

◆ DetectNewMovingPlatform()

virtual void MoreMountains.TopDownEngine.TopDownController3D.DetectNewMovingPlatform ( )
protectedvirtual

Detects any moving platform we may be standing on

◆ DetectObstacles()

override void MoreMountains.TopDownEngine.TopDownController3D.DetectObstacles ( float  distance,
Vector3  offset 
)
virtual

Performs a cardinal collision check and stores collision objects informations

Parameters
distance
offset

Reimplemented from MoreMountains.TopDownEngine.TopDownController.

◆ DetermineDirection()

override void MoreMountains.TopDownEngine.TopDownController3D.DetermineDirection ( )
protectedvirtual

Determines the direction based on the current movement

Reimplemented from MoreMountains.TopDownEngine.TopDownController.

◆ FixedUpdate()

override void MoreMountains.TopDownEngine.TopDownController3D.FixedUpdate ( )
protectedvirtual

On FixedUpdate we process our Update computations if UpdateMode is set to FixedUpdate

Reimplemented from MoreMountains.TopDownEngine.TopDownController.

◆ GetMovingPlatformVelocity()

virtual void MoreMountains.TopDownEngine.TopDownController3D.GetMovingPlatformVelocity ( )
protectedvirtual

Gets the current moving platform's velocity

◆ HandleAdvancedGroundDetection()

virtual void MoreMountains.TopDownEngine.TopDownController3D.HandleAdvancedGroundDetection ( )
protectedvirtual

◆ HandleFriction()

override void MoreMountains.TopDownEngine.TopDownController3D.HandleFriction ( )
protectedvirtual

Handles friction with ground surfaces, coming soon

Reimplemented from MoreMountains.TopDownEngine.TopDownController.

◆ HandleGroundContact()

virtual void MoreMountains.TopDownEngine.TopDownController3D.HandleGroundContact ( )
protectedvirtual

We handle ground contact, velocity transfer and moving platforms

◆ Impact()

override void MoreMountains.TopDownEngine.TopDownController3D.Impact ( Vector3  direction,
float  force 
)
virtual

Applies an impact to the character of the specified direction and force

Parameters
direction
force

Reimplemented from MoreMountains.TopDownEngine.TopDownController.

◆ IsGroundedTest()

virtual bool MoreMountains.TopDownEngine.TopDownController3D.IsGroundedTest ( )
virtual

Whether or not the character is grounded

Returns

◆ IsSliding()

virtual bool MoreMountains.TopDownEngine.TopDownController3D.IsSliding ( )
virtual

whether or not the character is sliding down a steep slope

◆ LateUpdate()

override void MoreMountains.TopDownEngine.TopDownController3D.LateUpdate ( )
protectedvirtual

On late update we apply any impact we have in store, and store our velocity for use next frame

Reimplemented from MoreMountains.TopDownEngine.TopDownController.

◆ ManualControllerColliderHit()

virtual void MoreMountains.TopDownEngine.TopDownController3D.ManualControllerColliderHit ( )
protectedvirtual

This method compensates for the regular OnControllerColliderHit, which unfortunately generates a lot of garbage. To do so, it casts a ray downwards to get our ground normal, and a ray in the current movement direction to (potentially) push rigidbodies

◆ MoveCharacterController()

virtual void MoreMountains.TopDownEngine.TopDownController3D.MoveCharacterController ( )
protectedvirtual

Moves the character controller by the computed _motion

◆ MovePosition()

override void MoreMountains.TopDownEngine.TopDownController3D.MovePosition ( Vector3  newPosition)
virtual

Moves this character to the specified position while trying to avoid obstacles

Parameters
newPosition

Reimplemented from MoreMountains.TopDownEngine.TopDownController.

◆ MoveWithPlatform()

virtual void MoreMountains.TopDownEngine.TopDownController3D.MoveWithPlatform ( )
protectedvirtual

Moves and rotates the character controller to follow any moving platform we may be standing on

◆ OnTriggerEnter()

virtual void MoreMountains.TopDownEngine.TopDownController3D.OnTriggerEnter ( Collider  other)
protectedvirtual

When triggering with something else, we check if it's a moving platform and we push ourselves if needed

Parameters
other

◆ ProcessUpdate()

virtual void MoreMountains.TopDownEngine.TopDownController3D.ProcessUpdate ( )
protectedvirtual

Computes the new velocity and moves the character

◆ Reset()

override void MoreMountains.TopDownEngine.TopDownController3D.Reset ( )
virtual

On reset, we reset vectors and transforms

Reimplemented from MoreMountains.TopDownEngine.TopDownController.

◆ ResetColliderSize()

override void MoreMountains.TopDownEngine.TopDownController3D.ResetColliderSize ( )
virtual

Returns the collider to its initial size

Reimplemented from MoreMountains.TopDownEngine.TopDownController.

◆ ResizeColliderHeight()

override void MoreMountains.TopDownEngine.TopDownController3D.ResizeColliderHeight ( float  newHeight,
bool  translateCenter = false 
)
virtual

Resizes the collider to the new size set in parameters

Parameters
newSizeNew size.

Reimplemented from MoreMountains.TopDownEngine.TopDownController.

◆ SetKinematic()

override void MoreMountains.TopDownEngine.TopDownController3D.SetKinematic ( bool  state)
virtual

Turns this character's rigidbody kinematic or not

Parameters
state

Reimplemented from MoreMountains.TopDownEngine.TopDownController.

◆ SetMovement()

override void MoreMountains.TopDownEngine.TopDownController3D.SetMovement ( Vector3  movement)
virtual

Sets the character's current input direction and magnitude

Parameters
movement

Reimplemented from MoreMountains.TopDownEngine.TopDownController.

◆ ShouldMoveWithPlatformThisFrame()

virtual bool MoreMountains.TopDownEngine.TopDownController3D.ShouldMoveWithPlatformThisFrame ( )
protectedvirtual

Whether or not our character should move with the moving platform this frame

Returns

◆ SubstractNewPlatformVelocity()

virtual IEnumerator MoreMountains.TopDownEngine.TopDownController3D.SubstractNewPlatformVelocity ( )
protectedvirtual

Computes the relative velocity

Returns

◆ TooSteep()

virtual bool MoreMountains.TopDownEngine.TopDownController3D.TooSteep ( )
virtual

whether or not the current surface is too steep or not

◆ Update()

override void MoreMountains.TopDownEngine.TopDownController3D.Update ( )
protectedvirtual

On Update we process our Update computations if UpdateMode is set to Update

Reimplemented from MoreMountains.TopDownEngine.TopDownController.

Member Data Documentation

◆ _canGoBackHeadCheck

RaycastHit MoreMountains.TopDownEngine.TopDownController3D._canGoBackHeadCheck
protected

◆ _capsulePoint1

Vector3 MoreMountains.TopDownEngine.TopDownController3D._capsulePoint1
protected

◆ _capsulePoint2

Vector3 MoreMountains.TopDownEngine.TopDownController3D._capsulePoint2
protected

◆ _cardinalRaycast

RaycastHit MoreMountains.TopDownEngine.TopDownController3D._cardinalRaycast
protected

◆ _characterController

CharacterController MoreMountains.TopDownEngine.TopDownController3D._characterController
protected

◆ _collider

Collider MoreMountains.TopDownEngine.TopDownController3D._collider
protected

◆ _collisionFlags

CollisionFlags MoreMountains.TopDownEngine.TopDownController3D._collisionFlags
protected

◆ _detached

bool MoreMountains.TopDownEngine.TopDownController3D._detached = false
protected

◆ _downRaycastsOffset

Vector3 MoreMountains.TopDownEngine.TopDownController3D._downRaycastsOffset
protected

◆ _emptyRaycast

RaycastHit MoreMountains.TopDownEngine.TopDownController3D._emptyRaycast = new RaycastHit()
protected

◆ _frameVelocity

Vector3 MoreMountains.TopDownEngine.TopDownController3D._frameVelocity = Vector3.zero
protected

◆ _hitPoint

Vector3 MoreMountains.TopDownEngine.TopDownController3D._hitPoint = Vector3.zero
protected

◆ _horizontalVelocityDelta

Vector3 MoreMountains.TopDownEngine.TopDownController3D._horizontalVelocityDelta
protected

◆ _idealDirection

Vector3 MoreMountains.TopDownEngine.TopDownController3D._idealDirection
protected

◆ _idealVelocity

Vector3 MoreMountains.TopDownEngine.TopDownController3D._idealVelocity
protected

◆ _lastGroundNormal

Vector3 MoreMountains.TopDownEngine.TopDownController3D._lastGroundNormal = Vector3.zero
protected

◆ _lastHitPoint

Vector3 MoreMountains.TopDownEngine.TopDownController3D._lastHitPoint = new Vector3(Mathf.Infinity, 0, 0)
protected

◆ _lastHorizontalVelocity

Vector3 MoreMountains.TopDownEngine.TopDownController3D._lastHorizontalVelocity
protected

◆ _lastMovingPlatformMatrix

Matrix4x4 MoreMountains.TopDownEngine.TopDownController3D._lastMovingPlatformMatrix
protected

◆ _longestDistance

float MoreMountains.TopDownEngine.TopDownController3D._longestDistance = Single.MinValue
protected

◆ _motion

Vector3 MoreMountains.TopDownEngine.TopDownController3D._motion
protected

◆ _movePositionDirection

Vector3 MoreMountains.TopDownEngine.TopDownController3D._movePositionDirection
protected

◆ _movePositionDistance

float MoreMountains.TopDownEngine.TopDownController3D._movePositionDistance
protected

◆ _movePositionHit

RaycastHit MoreMountains.TopDownEngine.TopDownController3D._movePositionHit
protected

◆ _moveWithPlatformGlobalPoint

Vector3 MoreMountains.TopDownEngine.TopDownController3D._moveWithPlatformGlobalPoint
protected

◆ _moveWithPlatformGlobalRotation

Quaternion MoreMountains.TopDownEngine.TopDownController3D._moveWithPlatformGlobalRotation
protected

◆ _moveWithPlatformMoveDistance

Vector3 MoreMountains.TopDownEngine.TopDownController3D._moveWithPlatformMoveDistance
protected

◆ _moveWithPlatformRotationDiff

Quaternion MoreMountains.TopDownEngine.TopDownController3D._moveWithPlatformRotationDiff
protected

◆ _movingPlatformCurrentGlobalPoint

Vector3 MoreMountains.TopDownEngine.TopDownController3D._movingPlatformCurrentGlobalPoint
protected

◆ _movingPlatformCurrentHitCollider

Transform MoreMountains.TopDownEngine.TopDownController3D._movingPlatformCurrentHitCollider
protected

◆ _movingPlatformCurrentHitColliderLocal

Vector3 MoreMountains.TopDownEngine.TopDownController3D._movingPlatformCurrentHitColliderLocal
protected

◆ _movingPlatformGlobalRotation

Quaternion MoreMountains.TopDownEngine.TopDownController3D._movingPlatformGlobalRotation
protected

◆ _movingPlatformHitCollider

Transform MoreMountains.TopDownEngine.TopDownController3D._movingPlatformHitCollider
protected

◆ _movingPlatformLocalRotation

Quaternion MoreMountains.TopDownEngine.TopDownController3D._movingPlatformLocalRotation
protected

◆ _movingPlatformVelocity

Vector3 MoreMountains.TopDownEngine.TopDownController3D._movingPlatformVelocity
protected

◆ _newHorizontalVelocity

Vector3 MoreMountains.TopDownEngine.TopDownController3D._newHorizontalVelocity
protected

◆ _newMovingPlatform

bool MoreMountains.TopDownEngine.TopDownController3D._newMovingPlatform
protected

◆ _newVelocity

Vector3 MoreMountains.TopDownEngine.TopDownController3D._newVelocity
protected

◆ _onTriggerEnterPushbackDirection

Vector3 MoreMountains.TopDownEngine.TopDownController3D._onTriggerEnterPushbackDirection
protected

◆ _originalColliderCenter

Vector3 MoreMountains.TopDownEngine.TopDownController3D._originalColliderCenter
protected

◆ _originalColliderHeight

float MoreMountains.TopDownEngine.TopDownController3D._originalColliderHeight
protected

◆ _originalSizeRaycastOrigin

Vector3 MoreMountains.TopDownEngine.TopDownController3D._originalSizeRaycastOrigin
protected

◆ _raycastDownDirection

Vector3 MoreMountains.TopDownEngine.TopDownController3D._raycastDownDirection = Vector3.down
protected

◆ _raycastDownHit

RaycastHit MoreMountains.TopDownEngine.TopDownController3D._raycastDownHit
protected

◆ _rigidBody

Rigidbody MoreMountains.TopDownEngine.TopDownController3D._rigidBody
protected

◆ _smallestDistance

float MoreMountains.TopDownEngine.TopDownController3D._smallestDistance = Single.MaxValue
protected

◆ _smallestRaycast

RaycastHit MoreMountains.TopDownEngine.TopDownController3D._smallestRaycast
protected

◆ _stickyOffset

float MoreMountains.TopDownEngine.TopDownController3D._stickyOffset = 0f
protected

◆ _tooSteepLastFrame

bool MoreMountains.TopDownEngine.TopDownController3D._tooSteepLastFrame
protected

◆ _transform

Transform MoreMountains.TopDownEngine.TopDownController3D._transform
protected

◆ _waitForFixedUpdate

WaitForFixedUpdate MoreMountains.TopDownEngine.TopDownController3D._waitForFixedUpdate = new WaitForFixedUpdate()
protected

◆ GroundedComputationMode

GroundedComputationModes MoreMountains.TopDownEngine.TopDownController3D.GroundedComputationMode = GroundedComputationModes.Advanced

the selected modes to compute grounded state. Simple should only be used if your ground is even and flat

◆ GroundedRaycastLength

float MoreMountains.TopDownEngine.TopDownController3D.GroundedRaycastLength = 5f

the length of the raycasts to cast downwards

◆ GroundNormal

Vector3 MoreMountains.TopDownEngine.TopDownController3D.GroundNormal = Vector3.zero

the current surface normal vector

◆ GroundNormalHeightThreshold

float MoreMountains.TopDownEngine.TopDownController3D.GroundNormalHeightThreshold = 0.2f

a threshold against which to check when going over steps. Adjust that value if your character has issues going over small steps

◆ ImpactFalloff

float MoreMountains.TopDownEngine.TopDownController3D.ImpactFalloff = 5f

the speed at which external forces get lerped to zero

◆ InputMoveDirection

Vector3 MoreMountains.TopDownEngine.TopDownController3D.InputMoveDirection = Vector3.zero

the current input sent to this character

◆ MaximumFallSpeed

float MoreMountains.TopDownEngine.TopDownController3D.MaximumFallSpeed = 20.0f

the maximum vertical velocity the character can have while falling

◆ MinimumGroundedDistance

float MoreMountains.TopDownEngine.TopDownController3D.MinimumGroundedDistance = 0.2f

the distance to the ground beyond which the character isn't considered grounded anymore

◆ ObstaclesLayerMask

LayerMask MoreMountains.TopDownEngine.TopDownController3D.ObstaclesLayerMask = LayerManager.ObstaclesLayerMask

the layer to consider as obstacles (will prevent movement)

◆ SlideOnSteepSurfaces

bool MoreMountains.TopDownEngine.TopDownController3D.SlideOnSteepSurfaces = true

whether or not the character should slide while standing on steep surfaces

◆ SlidingDirectionControl

float MoreMountains.TopDownEngine.TopDownController3D.SlidingDirectionControl = 1f

the control the player has on the direction while sliding down

◆ SlidingSpeed

float MoreMountains.TopDownEngine.TopDownController3D.SlidingSpeed = 15f

the speed at which the character should slide

◆ SlidingSpeedControl

float MoreMountains.TopDownEngine.TopDownController3D.SlidingSpeedControl = 0.4f

the control the player has on the speed while sliding down

◆ SlopeSpeedMultiplier

AnimationCurve MoreMountains.TopDownEngine.TopDownController3D.SlopeSpeedMultiplier = new AnimationCurve(new Keyframe(-90, 1), new Keyframe(0, 1), new Keyframe(90, 0))

the factor by which to multiply the speed while walking on a slope. x is the angle, y is the factor

◆ UpdateMode

UpdateModes MoreMountains.TopDownEngine.TopDownController3D.UpdateMode = UpdateModes.FixedUpdate

whether the movement computation should occur at Update or FixedUpdate. FixedUpdate is the recommended choice.

◆ VelocityTransferMethod

VelocityTransferOnJump MoreMountains.TopDownEngine.TopDownController3D.VelocityTransferMethod = VelocityTransferOnJump.FloorVelocity

how the velocity should be affected when jumping from a moving ground

Property Documentation

◆ ColliderBottom

override Vector3 MoreMountains.TopDownEngine.TopDownController3D.ColliderBottom
get

returns the bottom coordinate of the collider

◆ ColliderCenter

override Vector3 MoreMountains.TopDownEngine.TopDownController3D.ColliderCenter
get

returns the center coordinate of the collider

◆ ColliderTop

override Vector3 MoreMountains.TopDownEngine.TopDownController3D.ColliderTop
get

returns the top coordinate of the collider

◆ ExitedTooSteepSlopeThisFrame

virtual bool MoreMountains.TopDownEngine.TopDownController3D.ExitedTooSteepSlopeThisFrame
getset

whether or not the character just entered a slope/ground not too steep this frame

◆ MovingPlatformSpeed

override Vector3 MoreMountains.TopDownEngine.TopDownController3D.MovingPlatformSpeed
get

the speed of the moving platform

◆ OnAMovingPlatform

override bool MoreMountains.TopDownEngine.TopDownController3D.OnAMovingPlatform
get

whether or not the character is on a moving platform


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