Answer the question
In order to leave comments, you need to log in
Rotate ui behind camera?
There is a Canvas on the scene with an Image in it - the Canvas is a child of the camera and rotates behind it - but the problem is that the Image doesn't rotate behind the camera, but is a child of the Canvas - why?
well, I need the ui to move behind the camera in vr - like a pointer
I'm surprised why the following script does not work for the orange circle
GameObject ParentTransform = transform.parent.gameObject;
transform.position = new Vector3(ParentTransform.transform.position.x, ParentTransform.transform.position.y, ParentTransform.transform.position.z);
Answer the question
In order to leave comments, you need to log in
Found a solution:
void RotAin()
{
int x = 1;
if (x==1)
{
gameObject.transform.position = new Vector3(transform.rotation.w, transform.rotation.w, gameObject.transform.position.z);
x++;
}
else
{
gameObject.transform.position = new Vector3(transform.rotation.w, gameObject.transform.rotation.y, gameObject.transform.position.z);
}
}
void RotAin()
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question