MovementSpeedComponent allows to smoothly change speed of controlled character.
It has few different movement states E_MovementStates.
We can set different speed values to each of them.
There are few variables that can be modified in this component.
- SpeedChangeInterpSpeed - how fast speed from current state will be interpolated to speed of next state
StatesToToggle - mostly used on player’s blueprint to toggle between walk and jog states using single input
e.g player presses CapsLook to toggle state
Functions to control movement speed.
- SetMovementState - sets new movement state
- ToggleState - toggles movement states between those stored in StatesToToggle array
- GetMovementState - returns current movement state
- GetMaxPossibleSpeed - returns max walk speed e.g if character is interpolating from walk to sprint, it will return sprint speed, not it’s currently interpolated speed