-
-
Notifications
You must be signed in to change notification settings - Fork 2
Player Force Base
eisclimber edited this page Apr 20, 2024
·
1 revision
abstract class in ExPresSXR.Movement / Extends MonoBehavior
A base class that can be used to apply a force on the player, while providing an solution for the use with teleportation movement.
Important: Derived classes must implement the movement itself by calling _characterController.Move()
during Update()
but only apply the force only _forceTemporarilyDisabled
.
You should also not disable the components if you are planning on not applying the force for an unspecified duration as it might cause interference. Create a variable in your script instead. See PlayerGravity
, PlayerRigidForce
and ClimbingGravityManager
for reference.
-
InputActionReference[] _inputActionPausingForce
: InputActions that temporarily disable the force for the specified duration. You want to set it to the InputsActions used for teleportation. -
float _forcePauseDuration
: Duration for how long the force will be temporarily disabled. Default:0.1f
-
CharacterController _characterController
: CharacterController to be manipulated.
-
bool _forceTemporarilyDisabled
: Will be true if the force is temporarily disabled after a input action was performed. Do not apply the force in these cases to allow teleport movement.
-
Vector3 _currentVelocity;
: (Readonly/Protected field) The current velocity applied.
-
virtual void OnEnable()
: Adds a callback that temporary pauses the force. -
virtual void OnDisable()
: Removes callback that temporary pause the force. -
virtual void PauseForce(InputAction.CallbackContext _)
: Callback that pauses the the force for the specified time. -
virtual IEnumerator PauseForceCoroutine()
: Coroutine function that pauses the force temporarily.
-
void ClearVelocity()
: Sets the current velocity to (0, 0, 0).
Autor: Luca 'eisclimber' Dreiling; License: MIT
- Getting Started
- Development and Contribution
- Misc
- Experimentation
- Data Gatherering
- Eye Tracking
- ExPresS XR Rig
- Interaction
- Base Button
- Button Quiz
- Collision Hand Rumbler
- Collision Sound Emitter
- Exit Game Interactable (Script Deprecated)
- Interactables
- Haptic Impulse Trigger
- Socket Interactors
- Inverse Kinematics
- Localization
- Minigames
- Coin Scale
- Coin Throw
- Sword Cleaning
- Misc
- Movement
- Presentation
- UI