How to make the first person controller float / go to the direction it wants just by pointing at it? I have a first person controller as a whale in an underwater environment. I want to make it be able to ‘swim’, so that it is not walking like human at the bottom of the ocean floor.
Thanks!
1 Answer
1Controllers aren’t meant to rotate away from their up-down orientation; you’ll probably want to go to a kinematic rigidbody (or you can just rotate the model, but that might run into funky clipping issues).
But, the common way is to use the transform’s local directions as movement guides. For example:
if ( Input.GetKey( KeyCode.W ) ) transform.position += transform.forward * speed * Time.deltaTime;