I have a small project where I am developing character movement. Currently, it works as follows: when the user presses one of the buttons (WASD), I rotate the character in the desired direction using the setEulerAngles function. Accordingly, the character always moves in one direction when the same button is pressed. I want the character to turn, for example, to the right and for the camera to rotate in the same direction (i.e., look at the back of the character) so that when the D key is pressed, the character moves to the right, when W is pressed, it moves straight, etc. I saw that project, but I don’t want the camera to rotate the character on each frame, only change the direction of movement of the corresponding keys. I don’t understand how to do this properly.
I know that cameras, like any other Entity, have the properties “forward” and “right”. But I’m not sure how to use them correctly.