DESPERATE How to align transform.up with another vector3 (direction) ?
Hello, I have been working on this for atleast 6 hours and everytime i keep getting stuck on this issue, my goal is to make the players transform.up equal to the normal of a raycasthit basically rotating so that the top is equal to the "top" of this other object
I really need help! im using a rigidbody if that means anything
any help is appreciated!
thanks
Answer by z0code0z · Oct 05, 2019 at 09:59 PM
so i found the following setup on here :
Quaternion slopeRotation = Quaternion.FromToRotation(transform.up, RaycastSentToGrav.normal);
transform.rotation = Quaternion.Lerp(transform.rotation, slopeRotation * transform.rotation, 10f * Time.fixedDeltaTime);
and while it works, its inaccurate by over .5 degrees in atleast 2 axis
so now the question is how do i make this more accurate?
Your answer
Follow this Question
Related Questions
Trying to match two objects rotations smoothly. 0 Answers
Make rotation of two objects match in Unity3D 1 Answer
Problem. Pick up and Grab object script, except all objects in scene are picked up instead of one. 0 Answers
Player rotates spastically on all axes when camera is turned 0 Answers
Ray cast to object to transform, instead all objects with script transform. 0 Answers