- Home /
Rotate around position using a set rotation?
So I'm trying to rotate a Game Object around game objects used as rotation points. At the moment I'm parenting the game object under these rotation points and rotate them but I'm getting some weird unwanted side effects (scale and rotation gets a bit off after a while ex: 1.000354 in scale etc). But otherwise it works fine. Is it some weird stuff with parenting or is it some sort of gimbal lock effect? (Scale isn't changed anywhere in code)
transform.SetParent (RotationPivot.transform);
RotationPivot.transform.rotation = Quaternion.Euler (RotationValueX, 0, 0);
I was trying to use the RotateAround function first but as my Rotation is set elsewhere I couldn't get the results I wanted. It rotated alot faster than intended. I guess it added the rotation value every tick? The rotation value goes from 0 to 90.
it looked something like this transform.RotateAround(RotationPivot, Vector3.up, RotationValueX);
Answer by ZeN12 · Feb 16, 2018 at 03:49 PM
try to use +=, like here: RotationPivot.transform.rotation += Quaternion.Euler (RotationValueX, 0, 0);
Your answer
Follow this Question
Related Questions
RotateAround object in local space 1 Answer
Rotating game Object. 2 Answers
if statements with transform.rotation not working? 2 Answers
Transform.RotateAround Issues 1 Answer