- Home /
Question about topdown-movement and mouse-facing-foward-check
Hello folks,
I have a general question about moving the player within a topdown-based camera-system.
What I have done:
W,A,S,D is used as axis to move the player in a direction. The mouse cursor is used to define the direction where the player is looking at.
What I want to do is, that the player check if he is going in the direction of the mouse-cursor or backwards. Depending on that, the movespeed will be slower. As an example: The cursor is on the right side of the players object and the player hold D to walk right. Means he is walking to the cursor. Means foward. But I cant figure that out in my brain, how to solve that.
Have anyone an idea for me, how I can figure that out? Or have code that I can just analyse? Would be very appreciate :D
Greets Alex