Hey guys!
I’m working on a game similiar to the old “champions of” series.
My problem is that I cant seem to find a way to move my character and rotate it according to it’s movement direction.
Like when I press the A key it should walk left and look forward instead of walking sidewards like it’s the case in most FPS games.
Note:This is not a movement problem, it’s a rotation problem since I’m able to let the character walk in the desired way.
The only problem is that I cant find a way to make the character always look forward(In its movement direction).
When you work out which way to move, also work out which angle to face at the same time. E.g. when you press the A key, you’re moving the player left, you can set targetDir = 180 at the same time.
Then you can either just rotate immediately to that angle, or use Mathf.MoveTowardAngle to smoothly turn over several frames.
@LeftyRight: Won’t that just move the character forward in the direction he’s facing? The OP stated he knew how to move character… he just was looking for a way to rotate the character to the left if he started walking left. So it woudln’t look like the character was strafing.