I am trying to create a graphical interface for HTC VIVE, but I canβt open it at a certain level of the controller .
I did some work and got a little sketchy because my object is a child, because of which it is difficult for me to track its rotation or position, since I wanted it to open only when the controller is at a certain angle (like a guy looking on the watch)
Here are some visual examples:
This is my controller rotation without a GUI:

When I rotate the controller, the GUI should display something like this:

Here is some code that I controlled
void RayCastFromHead()
{
if (Physics.Raycast(dummy.position, dummy.up, out hitInfo, 30))
{
transform.rotation.ToAngleAxis(out tempAngle, out tempAxis);
if (hitInfo.collider.name.Contains("Camera (eye)"))
{
if (dummy.gameObject.GetComponent<MeshRenderer>().enabled)
{
if ((transform.localEulerAngles.z > 270.0f && transform.localEulerAngles.z < 315.0f)&&
(transform.position.y > 0.9f && transform.position.y < 2f))
{
staticRotaion = transform.localRotation;
canvasOnHead.GetComponent<TweenScale>().PlayForward();
}
}
}
}
}
, ? .
,

, , , - -
