- Home /
How to assign a rotation relative to another object?
There are Projects A and B. Is it possible to assign a rotation to an object (A) relative to one of the sub-project objects (B) without using SetParent help me What to do, what to look for?
Answer by Rs · Mar 25, 2019 at 09:03 AM
Your question is a bit confusing but if you are looking for object B to have the same rotation of object A plus an additional arbitrary rotation you can do
B. transform.rotation = A.transform.rotation * Quaternion.Euler(0f, 45f, 0f);
This would set B's rotation to A's rotation plus an additional 45 degrees.
Answer by Fluffy_Kaeloky · Mar 24, 2019 at 08:27 PM
I believe that what you are looking for is this : https://docs.unity3d.com/ScriptReference/Transform.RotateAround.html
EDIT : Just assign the transform.rotation of object A to object B then. If you want to add another rotation on top of that, multiply by another quaternion.
I do not think this is it! I generally need the rotation of the object to be the same as the rotation of another object
Your answer
Follow this Question
Related Questions
Rotate an object to a given point 2 Answers
How to turn the steering wheel 0 Answers
problem with object rotation 1 Answer
turning a project using AddTorque 0 Answers
what are the ways to attach objects 1 Answer