- Home /
Question by
Samuel-Karlos · May 31, 2016 at 01:42 PM ·
rotationgameobjecthead
Rotation object Cardboard
How to rotate an object when rotating the head of cardboard ? In my case the object is a child of the Head , with the object it is going along with the head , more does not rotate , I want to rotate together. How do I do that?
Comment
Not sure I completely understand but I've used lookat to make a compass work before.
Create an empty game object and drag it well off your game area. Then tell the cube to always look at that GO's transform.
public Transform myTarget;
void Update()
{
this.transfrom.LookAt(myTarget);
}
Put that on your Cube and drag the empty GameObject onto the script's Transform slot.
In theory, as your head rotates with the cube the cube remains looking at the GO so it should rotate from your point of view.
Hope that's what you wanted.