I have a GameObject (game object B) I’m instantiating from a pool manager pool.
I get the rotation from a GameObject (game object A) in the scene and I’d like to add an offset rotation to B, as if it was a child of A.
Can anyone help please?
I have a GameObject (game object B) I’m instantiating from a pool manager pool.
I get the rotation from a GameObject (game object A) in the scene and I’d like to add an offset rotation to B, as if it was a child of A.
Can anyone help please?
You want to look at the Quaternion operators at the bottom of the page. Specifically multiply:
So you want to multiply your initial rotation by your offset rotation. It’s easy to overlook because it’s just the regular * operator, but it’s been overloaded with special functionality to work with Quaternions.