playMaker

Author Topic: SteamVr OnTriggerEnter  (Read 5445 times)

jasonj_76

  • Playmaker Newbie
  • *
  • Posts: 10
    • View Profile
SteamVr OnTriggerEnter
« on: June 11, 2016, 09:02:37 PM »
Hi,

I'm a new user and I've been going through tutorials online.  I got the tutorial on Triggers (https://youtu.be/BYwkd80T5Zk) to work nicely but I thought it would be great to get it working with the Vive and SteamVr.  Unfortunately, the SteamVr camera doesn't seem to trigger the Trigger Event.  I've added a capsule collider to the steamvr camera and I can see it moving into the trigger, but nothing happens.  I've confirmed that this works with the First-Person Controller. 

Has anyone had any luck with this?

thanks for your help,
Jason

sebaslive

  • Hero Member
  • *****
  • Posts: 539
    • View Profile
    • Frame Tale Studios
Re: SteamVr OnTriggerEnter
« Reply #1 on: June 12, 2016, 01:07:59 PM »
Hi, did you try adding a rigidbody?
All my VR games use Steam VR Playmaker Toolkit: http://u3d.as/u20
And Oculus Touch Playmaker Toolkit: http://u3d.as/QT5


Follow me @sebasRez

jasonj_76

  • Playmaker Newbie
  • *
  • Posts: 10
    • View Profile
Re: SteamVr OnTriggerEnter
« Reply #2 on: June 12, 2016, 05:45:41 PM »
Yeah, I've added a rigidbody and a collider to the Camera(Head) in the SteamVr rig. Unfortunately it still doesn't trigger.

sebaslive

  • Hero Member
  • *****
  • Posts: 539
    • View Profile
    • Frame Tale Studios
Re: SteamVr OnTriggerEnter
« Reply #3 on: June 12, 2016, 08:23:14 PM »
Ill do some tests tomorrow and see if I can help out.
All my VR games use Steam VR Playmaker Toolkit: http://u3d.as/u20
And Oculus Touch Playmaker Toolkit: http://u3d.as/QT5


Follow me @sebasRez

jasonj_76

  • Playmaker Newbie
  • *
  • Posts: 10
    • View Profile
Re: SteamVr OnTriggerEnter
« Reply #4 on: June 12, 2016, 08:35:00 PM »
Great, I appreciate the help.

-Jason

sebaslive

  • Hero Member
  • *****
  • Posts: 539
    • View Profile
    • Frame Tale Studios
Re: SteamVr OnTriggerEnter
« Reply #5 on: June 14, 2016, 06:31:47 PM »
Hey Jason I just tried it out and it worked on my end,

I placed a circle collider on my camera(head) and set it with a rigidBody and turned on trigger for the collider.

Then I placed a box with a box collider with trigger enabled. When I moved my head into the box collider I was able to OntriggerEnter with tag and it worked.
All my VR games use Steam VR Playmaker Toolkit: http://u3d.as/u20
And Oculus Touch Playmaker Toolkit: http://u3d.as/QT5


Follow me @sebasRez

jasonj_76

  • Playmaker Newbie
  • *
  • Posts: 10
    • View Profile
Re: SteamVr OnTriggerEnter
« Reply #6 on: June 19, 2016, 05:03:39 PM »
Thanks for taking a look.  I took another stab at it and tried your setup, but I'm still having issues. 

I must be doing something wrong on my end.  I can get it all to work with the regular fps camera, but not with steamvr. 

If you have a second, can you take a look to see what I'm doing wrong? Here is a link to the project:

[ADMIN: Link removed since it included Playmaker dlls]

thanks,
Jason

« Last Edit: June 19, 2016, 08:07:27 PM by Alex Chouls »

sebaslive

  • Hero Member
  • *****
  • Posts: 539
    • View Profile
    • Frame Tale Studios
Re: SteamVr OnTriggerEnter
« Reply #7 on: June 19, 2016, 10:34:42 PM »
Hey Jason so a couple of things you have to do.

first remove this package because it has your playmaker file in it :P
(edit: I see admin removed it already)

second, you have regular trigger event on your button with a regular box collider (by regular I mean that it is looking for 3D triggers) but on your camera (head) you placed a rigidbody2D with a circle collider 2D. Either change button to have a 2D collider as well with trigger2D Event instead of the regular Trigger Event OR remove the circle collider 2D and the rigidbody 2D on the camera with a regular rigidbody and a regular circle collider.

third and last, notice that the camera (head) also has a tag - MainCamera, even with all the changes from the last step you still need to set the triggers collide tag to Main Camera, instead of Untagged.

The reason the FPS controller worked was because it has that Character Controller (which is a regular 3D collider) and the tag is set to Untagged, which the button is set to look for.

When doing the changes don't forget to set to Is Trigger (which you have already set, but just in case).

That should do it!
All my VR games use Steam VR Playmaker Toolkit: http://u3d.as/u20
And Oculus Touch Playmaker Toolkit: http://u3d.as/QT5


Follow me @sebasRez

jasonj_76

  • Playmaker Newbie
  • *
  • Posts: 10
    • View Profile
Re: SteamVr OnTriggerEnter
« Reply #8 on: June 19, 2016, 11:12:24 PM »
Yes! That worked perfectly.  The collide tag on the trigger event was throwing me off, that was main culprit.  It didn't even cross my mind to change that to main_cam.  Thank you for taking the time to look at my setup and for helping me.   

-Jason


sebaslive

  • Hero Member
  • *****
  • Posts: 539
    • View Profile
    • Frame Tale Studios
Re: SteamVr OnTriggerEnter
« Reply #9 on: June 20, 2016, 05:27:20 AM »
Great! That has happened plenty of times to me and I had no idea why. Glad it worked out.
All my VR games use Steam VR Playmaker Toolkit: http://u3d.as/u20
And Oculus Touch Playmaker Toolkit: http://u3d.as/QT5


Follow me @sebasRez

fletcherkildren

  • Playmaker Newbie
  • *
  • Posts: 19
    • View Profile
Re: SteamVr OnTriggerEnter
« Reply #10 on: January 03, 2018, 04:54:14 AM »
Came across this - is there a way to adapt this to prevent collisions? Like make the camera not clip through things like the camera in Tomb Raider?

CraigItsFryday

  • Playmaker Newbie
  • *
  • Posts: 2
    • View Profile
Re: SteamVr OnTriggerEnter / Exit
« Reply #11 on: April 17, 2018, 06:49:20 AM »
Hi everyone,

I came across this thread looking for this exact answer. Unfortunately, the fixes for the OP have not been enough to fix my problem. I've been able to get my trigger to work using a simple sphere object with a trigger, but when I attempt to use a sphere collider on the SteamVR head object, it simply doesn't work. I'm wondering if it has something to do with teleporting into a volume instead of walking or moving my head directly into it? I've noticed the bezier ray (using Vive teleport via GitHub) bounces off of the trigger volume (or at least gives an invalid surface as feedback) but I've managed to teleport slowly into the volume. I've tried manually moving the CameraRig into the trigger volume and it doesn't fire off then either. I'm wondering if there's any advice on what to try next. Or if possibly updates to SteamVR could have broken this approach. I've had no other issues with triggers until trying to use them with SteamVR. Any help is appreciated. Thanks in advance.

CraigItsFryday

  • Playmaker Newbie
  • *
  • Posts: 2
    • View Profile
Re: SteamVr OnTriggerEnter
« Reply #12 on: April 17, 2018, 06:56:07 AM »
I guess sometimes the act of asking for help is alone enough. Immediately saw my problem after trying one more thing. In case someone else has the same issue, the head is disabled (for me, not sure) once the camera is running. Moving the rigidbody and collider (trigger) to the eyes allowed it to work for me.