Skip to content

Movement Direction

Mikhail Albershtein edited this page Apr 1, 2020 · 2 revisions

#Purpose Movement direction is a layer to tell where to move the character based on the inputs and the camera.
I wanted the movement to be independent of the input and the camera, but obviously, it should be connected. That's why I decided to separate the actual physical movement and finding the direction to move. You still can communicate from movement to the movement direction to change the direction(void changeMovementDirection(IMovementDirection movementDirection) in Player class), thanks to setup/cleanup methods in movements, you can easily change the movement direction.

Vector3 getDirection()

That's a method to get the direction. Usually, you should call it in move(Vector3 direction) method of IMovement

Example - ThirdPersonCameraDirection

ThirdPersonCameraDirection