- Home /
Player Rotation while walking on wall
Hey Guys
I'm currently working on a 3d game where the player can walk on the wall. It works quite fine that the player walks on the wall. My only problem is the players rotation.
I'm working with cinemachine freecam so I changed the settings so the camera rotates to the wall aswell.
The issue / bug I got is that when I'm trying to rotate the player facing the same way as the camera does it works but only for a certain angle then it doesent rotates there anymore. I noticed that if I tweak the y and z rotation by putting away the minus and adding it to the other one the rotation works for the other half of the angle
I'm using this code to rotate and also using it for when the player is on the ground.
transform.localEulerAngles = new Vector3(playerCam.transform.localEulerAngles.x, transform.eulerAngles.y, transform.eulerAngles.z);
I made a little sketch to understand it better On the sketch u can see that the player isn't able to rotate on certain angles (green) but not on the red one. the under one is what I want to achieve.
Your answer
Follow this Question
Related Questions
Problems caused by non-unique Euler angle solutions 1 Answer
How to get Angle float of specific axis.(Turret clamping related). 2 Answers
Instantiating an object in front of the player 3 Answers
When applying a 90 degree rotation to Euler Angles, it is over/undershooting sometimes.. 2 Answers
Camera Zoom from rotation. 0 Answers