Search Unity

GvrControllerPointer not working with a Collider

Discussion in 'Daydream' started by HeyBishop, Jun 22, 2017.

  1. HeyBishop

    HeyBishop

    Joined:
    Jun 22, 2017
    Posts:
    238
    Hello! I'm new to Unity.

    I'm experimenting/learning to create movement of a player using the Daydream Controller. I'm building on the Roll-a-ball game. I've gotten it to work two different ways: walk in a direction based on where I'm touching the TouchPad with TouchPos, or the direction I'm looking when I ClickButton is true.

    Trouble is, when I add a collider to my player (so that I can't move through walls, etc.), the pointer stops working. When I disable the collider, the raycast works fine - and my spinning cubes change colour when the pointer enters. When the collider is enabled, it points in the wrong direction. I encounter the same pointing problem when I add a Character Controller.

    Any ideas what's wrong?
    UnityColliderWoes.jpg
     
    Last edited: Jun 22, 2017
  2. pfreema1

    pfreema1

    Joined:
    Apr 5, 2017
    Posts:
    21
  3. HeyBishop

    HeyBishop

    Joined:
    Jun 22, 2017
    Posts:
    238
    Thank you pfreema1. I hadn't considered changing the object's layer to "Ignore raycast" . Alas, it didn't change anything.
    I'll read through the rest of that post you linked me to, and see if there are other ideas in there that might help.
     
  4. dsternfeld

    dsternfeld

    Official Google Employee

    Joined:
    Jan 3, 2017
    Posts:
    72
    In addition to changing the object's layer to "Ignore Raycast" check to make sure that any GvrPointerPhysicsRaycaster or GvrPointerGraphicRaycaster scripts that you have in the scene don't have the "Ignore Raycast" layer checked in the Raycaster Event Mask.

    I hope that helps!

    -Dan
     
    tengio and HeyBishop like this.
  5. HeyBishop

    HeyBishop

    Joined:
    Jun 22, 2017
    Posts:
    238
    Bingo!
    I hadn't unchecked "Ignore Raycast" in the Raycaster Event Mask of GvrPointerPhysicsRaycaster.
    Many thanks!!
     
    dsternfeld likes this.
  6. ddi7i4d

    ddi7i4d

    Joined:
    Sep 21, 2017
    Posts:
    7
    @dsternfeld @HeyBishop
    Sorry, I am a bit lost. I don’t understand where to uncheck Ignore Raycast, no object in my hierarchy has the GvrPointerPhysicsRaycaster or GvrPointerGraphicRaycaster script assigned?
     
  7. dsternfeld

    dsternfeld

    Official Google Employee

    Joined:
    Jan 3, 2017
    Posts:
    72
    Hi ddi7i4d, can you describe the problem you are seeing?

    GvrPointerPhysicsRaycaster and GvrPointerGraphicRaycaster are replacements for Unity's PhysicsRaycaster and GraphicRaycaster, and you need to add them into your scene yourself along with the GvrEventSystem prefab if you want to use the controller raycasting provided with the SDK.

    Thanks,

    Dan
     
  8. ddi7i4d

    ddi7i4d

    Joined:
    Sep 21, 2017
    Posts:
    7
    Edit: I found it, I thought it would be on one of the Gvr.. Prefabs, but it is on the main camera. Thanks for your help!

    Thanks @dsternfeld , I am very new to Unity and trying to understand what all these Gvr Prefabs are for. In the inspector, the GvrEventSystem looks like this, shouldn’t I find GvrPointerPhysicsRaycaster and GvrPointerGraphicRaycaster there?
    If I understand you correctly, I should assign GvrPointerPhysicsRaycaster and GvrPointerGraphicRaycaster to any object in the scene to have access to them?

     
    dsternfeld likes this.