TopDown Engine v4.5
Loading...
Searching...
No Matches
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 { Simple , Advanced }
 the possible modes to compute grounded state. Simple should only be used if your ground is even and flat More...
enum  UpdateModes { Update , FixedUpdate }
 the different possible update modes More...
enum  VelocityTransferOnJump { NoTransfer , InitialVelocity , FloorVelocity , 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
virtual bool CollidingAbove ()
 whether or not the character is colliding above
virtual bool TooSteep ()
 whether or not the current surface is too steep or not
virtual void DetachFromGround ()
 Forces the controller to detach from the ground.
virtual void DetachFromMovingPlatform ()
override bool CanGoBackToOriginalSize ()
 Determines whether this instance can go back to original size.
override void ResizeColliderHeight (float newHeight, bool translateCenter=false)
 Resizes the collider to the new size set in parameters.
override void ResetColliderSize ()
 Returns the collider to its initial size.
virtual bool IsGroundedTest ()
 Whether or not the character is grounded.
override void CollisionsOn ()
 Enables the collider.
override void CollisionsOff ()
 Disables collider.
override void DetectObstacles (float distance, Vector3 offset)
 Performs a cardinal collision check and stores collision objects informations.
override void AddForce (Vector3 movement)
 Adds a force of the specified direction and magnitude to the character.
override void Impact (Vector3 direction, float force)
 Applies an impact to the character of the specified direction and force.
override void SetMovement (Vector3 movement)
 Sets the character's current input direction and magnitude.
override void SetKinematic (bool state)
 Turns this character's rigidbody kinematic or not.
override void MovePosition (Vector3 newPosition, bool targetTransform=false)
 Moves this character to the specified position while trying to avoid obstacles.
override void Reset ()
 On reset, we reset vectors and transforms.
Public Member Functions inherited from MoreMountains.TopDownEngine.TopDownController
virtual void SetGravityActive (bool status)
 Sets gravity active or inactive.

Public Attributes

Vector3 InputMoveDirection = Vector3.zero
 the current input sent to this character
UpdateModes UpdateMode = UpdateModes.FixedUpdate
 whether the movement computation should occur at Update or FixedUpdate. FixedUpdate is the recommended choice.
VelocityTransferOnJump VelocityTransferMethod = VelocityTransferOnJump.FloorVelocity
 how the velocity should be affected when jumping from a moving ground
LayerMask ObstaclesLayerMask = LayerManager.ObstaclesLayerMask
 the layer to consider as obstacles (will prevent movement)
float GroundedRaycastLength = 5f
 the length of the raycasts to cast downwards
float MinimumGroundedDistance = 0.2f
 the distance to the ground beyond which the character isn't considered grounded anymore
GroundedComputationModes GroundedComputationMode = GroundedComputationModes.Advanced
 the selected modes to compute grounded state. Simple should only be used if your ground is even and flat
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
float ImpactFalloff = 5f
 the speed at which external forces get lerped to zero
float MaximumFallSpeed = 20.0f
 the maximum vertical velocity the character can have while falling
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
Vector3 GroundNormal = Vector3.zero
 the current surface normal vector
bool SlideOnSteepSurfaces = true
 whether or not the character should slide while standing on steep surfaces
float SlidingSpeed = 15f
 the speed at which the character should slide
float SlidingSpeedControl = 0.4f
 the control the player has on the speed while sliding down
float SlidingDirectionControl = 1f
 the control the player has on the direction while sliding down
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)
bool GravityActive = true
 whether or not the gravity is currently being applied to this character
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
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
Vector3 Speed
 the current speed of the character
Vector3 Velocity
 the current velocity
Vector3 VelocityLastFrame
 the velocity of the character last frame
Vector3 Acceleration
 the current acceleration
bool Grounded
 whether or not the character is grounded
bool JustGotGrounded
 whether or not the character got grounded this frame
Vector3 CurrentMovement
 the current movement of the character
Vector3 CurrentDirection
 the direction the character is going in
float Friction
 the current friction
Vector3 AddedForce
 the current added force, to be added to the character's movement
bool FreeMovement = true
 whether or not the character is in free movement mode or not

Protected Member Functions

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

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
override Vector3 ColliderBottom [get]
 returns the bottom coordinate of the collider
override Vector3 ColliderTop [get]
 returns the top coordinate of the collider
virtual bool ExitedTooSteepSlopeThisFrame [get, set]
 whether or not the character just entered a slope/ground not too steep this frame
override bool OnAMovingPlatform [get]
 whether or not the character is on a moving platform
override Vector3 MovingPlatformSpeed [get]
 the speed of the moving platform
Quaternion MoveWithPlatformGlobalRotation [get]
Quaternion MoveWithPlatformRotationDiff [get]
Properties inherited from MoreMountains.TopDownEngine.TopDownController
virtual Vector3 ColliderCenter [get]
 the collider's center coordinates
virtual Vector3 ColliderBottom [get]
 the collider's bottom coordinates
virtual Vector3 ColliderTop [get]
 the collider's top coordinates
virtual GameObject ObjectBelow [get, set]
 the object (if any) below our character
virtual SurfaceModifier SurfaceModifierBelow [get, set]
 the surface modifier object below our character (if any)
virtual Vector3 AppliedImpact [get]
virtual bool OnAMovingPlatform [get, set]
 whether or not the character is on a moving platform
virtual Vector3 MovingPlatformSpeed [get, set]
 the speed of the moving platform
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,
bool targetTransform = false )
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

◆ MoveWithPlatformGlobalRotation

Quaternion MoreMountains.TopDownEngine.TopDownController3D.MoveWithPlatformGlobalRotation
get

◆ MoveWithPlatformRotationDiff

Quaternion MoreMountains.TopDownEngine.TopDownController3D.MoveWithPlatformRotationDiff
get

◆ 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:
  • H:/Code/MoreMountains/topdownengine/Assets/TopDownEngine/Common/Scripts/Characters/Core/TopDownController3D.cs