walking on walls help
I am building a fps character controler that rotates its Vector3.up to match the normal of a plane that I am moving toward. allowing the controler to walk up walls/cellings. The problem I am having, is that when contacting certain planes the controller will suddenly rotate 180 or 90 degrees to the left/right. This makes walking in a perfect loop along my map's interior difficult and disorienting. Any ideas on how to fix this? orgRot = Original Rotation sticknorm = the normal the controller aligns with.
Quaternion orgRot= transform.rotation; Quaternion dstRot = Quaternion.FromToRotation(Vector3.up, sticknorm); transform.rotation = Quaternion.Slerp(orgRot, dstRot, Time.deltaTime*5);
Your answer
Follow this Question
Related Questions
Error CS0103 0 Answers
Player still move left&right in MenuUI 0 Answers
IsGrounded flickers when hitting a wall 0 Answers