googlevr / gvr-unity-sdk

Google VR SDK for Unity
http://developers.google.com/vr/unity/
Other
2.71k stars 1.09k forks source link

GvrRectile not responding to objects #350

Closed pushonTunde closed 7 years ago

pushonTunde commented 7 years ago

So I've added a GvrReticle but it doesn't respond to object within the scene by expanding the dot. Example image below.

Game running with GvrRectile

When i move this over an object i.e. the tree's in my terrain or a cube the circle doesn't seem to expand. I've followed the following steps with setting up the GvrRectile within the scene as well.

Attached are some images of the objects and the attached component.

GvrViewerMain GvrRectile Main Camera Event System

The only thing that's attached to the main camera which isn't related to the gaze input is a walking script i created with the following code within it.

public class VRLookWalk : MonoBehaviour {

    public Transform vrCamera;

    public float toggleAngle = 30.0f;

    public float speed = 3.0f;

    public bool moveForward;

    private CharacterController myCC;

    private AudioSource audio;

    // Use this for initialization
    void Start () {

        myCC =  GetComponent<CharacterController> ();
        audio = GetComponent<AudioSource> ();

    }

    // Update is called once per frame
    void Update () {

        if (vrCamera.eulerAngles.x >= toggleAngle && vrCamera.eulerAngles.x < 90.0f) 
        {

            moveForward = true;

        } else {
            moveForward = false;
        }

        if (moveForward) {

            Vector3 forward = vrCamera.TransformDirection (Vector3.forward);
            myCC.SimpleMove (forward * speed);
            PlayWalking ();
        } else {
            StopWalking ();
        }   
    }

    void PlayWalking(){

        if (!audio.isPlaying)
        {
            audio.PlayOneShot (audio.clip,1);
        }

    }

    void StopWalking(){
        audio.Stop ();
    }
}
dhartwich1991 commented 7 years ago

hey @pushonTunde, sorry I know this is not related but I have a problem and saw you are using the same lookwalkscript as i do (from nurfacegames I guess :D) Did you manage to get the walking working on a daydream view? for me it works on the "Game" view in unity but once I deploy to a real device I can look around but if I look down but I don't start walking. Any idea?

dhartwich1991 commented 7 years ago

this is my stackoverflow issue: http://stackoverflow.com/questions/41100946/charactercontroller-simplemove-not-working-on-daydream-view

Selzier commented 7 years ago

Nurfacegames reporting! Thanks for checking my videos guys. Is the Camera a child of another transform? You cannot move the camera directly. "you cannot move the camera directly in Unity. Instead, the camera must be a child of another GameObject, and changes to the position and rotation must be applied to the parent’s Transform." https://unity3d.com/learn/tutorials/topics/virtual-reality/movement-vr

nathanmartz commented 7 years ago

Thanks, Selzier. I think you've addressed the core issue.

nekast commented 6 years ago

This one got me so I thought I'd mention it as part of this topic.

One other thing to check if you are having problems with GVR picking objects is that the GVR Reticle Pointer script has a max distance parameter. Any objects beyond this distance will not trigger the pointer events.

If the object that you are trying to trigger is farther away, you will need to up this distance value.

maxreticle