Class PlayerMotor
Assembly: Assembly-CSharp.dll
Syntax
[RequireComponent(typeof(PlayerSpeedChanger))]
[RequireComponent(typeof(CharacterController))]
public class PlayerMotor : MonoBehaviour
Fields
|
Improve this Doc
View Source
controller
Declaration
[HideInInspector]
[NonSerialized]
public CharacterController controller
Field Value
|
Improve this Doc
View Source
limitDiagonalSpeed
Declaration
public bool limitDiagonalSpeed
Field Value
|
Improve this Doc
View Source
smoothFollower
Declaration
public Transform smoothFollower
Field Value
|
Improve this Doc
View Source
smoothFollowerLerpSpeed
Declaration
public float smoothFollowerLerpSpeed
Field Value
|
Improve this Doc
View Source
systemTimerUpdatesDivisor
Declaration
public float systemTimerUpdatesDivisor
Field Value
Properties
|
Improve this Doc
View Source
CancelMovement
Cancels all movement impulses next frame.
Used to scrub movement impulse when player dies, opens inventory, or loads game.
Flag will be lowered again after movement cleared.
Declaration
public bool CancelMovement { get; set; }
Property Value
|
Improve this Doc
View Source
CollisionFlags
Declaration
public CollisionFlags CollisionFlags { get; set; }
Property Value
|
Improve this Doc
View Source
FreezeMotor
Freeze motor for an amount of time in seconds.
Used by teleport action to prevent player from falling when teleport is part of a physics change.
It can take a few frames for physics to catch up.
Declaration
public float FreezeMotor { get; set; }
Property Value
|
Improve this Doc
View Source
GroundedTime
Declaration
public float GroundedTime { get; }
Property Value
|
Improve this Doc
View Source
IsClimbing
Declaration
public bool IsClimbing { get; }
Property Value
|
Improve this Doc
View Source
IsCrouching
Declaration
public bool IsCrouching { get; set; }
Property Value
|
Improve this Doc
View Source
IsGrounded
Declaration
public bool IsGrounded { get; }
Property Value
|
Improve this Doc
View Source
IsJumping
Declaration
public bool IsJumping { get; }
Property Value
|
Improve this Doc
View Source
IsLevitating
Declaration
public bool IsLevitating { get; }
Property Value
|
Improve this Doc
View Source
IsMovingLessThanHalfSpeed
Declaration
public bool IsMovingLessThanHalfSpeed { get; }
Property Value
|
Improve this Doc
View Source
IsRiding
Declaration
public bool IsRiding { get; set; }
Property Value
|
Improve this Doc
View Source
IsRunning
Declaration
public bool IsRunning { get; }
Property Value
|
Improve this Doc
View Source
IsStandingStill
Declaration
public bool IsStandingStill { get; }
Property Value
|
Improve this Doc
View Source
IsSwimming
Declaration
public bool IsSwimming { get; }
Property Value
|
Improve this Doc
View Source
MoveDirection
Declaration
public Vector3 MoveDirection { get; }
Property Value
|
Improve this Doc
View Source
OnExteriorPath
The method by which player is standing on outdoor path.
Declaration
public bool OnExteriorPath { get; }
Property Value
|
Improve this Doc
View Source
OnExteriorStaticGeometry
The method by which player is standing on outdoor path.
Declaration
public bool OnExteriorStaticGeometry { get; }
Property Value
|
Improve this Doc
View Source
OnExteriorWater
The method by which player is standing on exterior water.
Declaration
public PlayerMotor.OnExteriorWaterMethod OnExteriorWater { get; }
Property Value
|
Improve this Doc
View Source
Speed
Declaration
public float Speed { get; }
Property Value
Methods
|
Improve this Doc
View Source
DistanceToPlayer(Vector3)
Declaration
public float DistanceToPlayer(Vector3 position)
Parameters
Type |
Name |
Description |
Vector3 |
position |
|
Returns
|
Improve this Doc
View Source
FindGroundPosition(Single)
Attempts to find the ground position below player, even if player is jumping/falling
Declaration
public Vector3 FindGroundPosition(float distance = 10F)
Parameters
Type |
Name |
Description |
Single |
distance |
Distance to fire ray.
|
Returns
Type |
Description |
Vector3 |
Hit point on surface below player, or player position if hit not found in distance.
|
|
Improve this Doc
View Source
FixStanding(Single, Single)
Declaration
public bool FixStanding(float extraHeight = 0F, float extraDistance = 0F)
Parameters
Type |
Name |
Description |
Single |
extraHeight |
|
Single |
extraDistance |
|
Returns
|
Improve this Doc
View Source
StartRestGroundedCheck()
Declaration
public bool StartRestGroundedCheck()
Returns
Extension Methods
MBExtensions.Invoke<T1, T2, T3, T4>(MonoBehaviour, Action<T1, T2, T3, T4>, T1, T2, T3, T4, Single)