- Home /
How to align the transform.rotation.y with the world space vector y?
My character can roll fall etc. I want him after that to standup and freeze constraints rotationZX. So how and with what function can I align the transform of the character with the word space vector up? I tried transform.rotation = Quaternion.LookRotation(transform.up, Vector3.up);
But it didn't always work (I tried without any constraints). Should I maybe use the Quaternion.FromToRotation()
? I still can't get a clear picture in my head of how these functions work. Someone told me that u can see a quaternion as a point on a sphere with two points u can have a rotation, so that's why I though transform.up, Vector3.up...
Answer by KazYamof · May 17, 2019 at 01:40 PM
transform.up = Vector3.up;
Oh lol, thank you is there a way I can get him there smoothly not just in one frame? @$$anonymous$$azYamof
transform.up = Vector3.Lerp(transform.up, Vector3.up, speed * Time.deltaTime);