VRTK_BodyPhysics Generates Physics Response Upon Colliding with Trigger Colliders

Created on 26 May 2017  路  13Comments  路  Source: ExtendRealityLtd/VRTK

Environment

  • Source of VRTK (Github)
  • Commit cf63d2b5bd173931900b6dc3b89aba5684f09247
  • Unity 5.6.1p1
  • Vive)
  • SDK used (e.g. OpenVR/SteamVR/Oculus Utilities)

Steps to reproduce

  1. Create a basic default VRTK scene.
  2. Add a trigger collider to the scene.
  3. Move into the trigger collider.

Expected behavior

VRTK_BodyPhysics does not generate a physics response when the player object collides with a collider set to trigger.

Current behavior

VRTK_BodyPhysics generates a physics response.

There is a workaround, and that is to add a VRTK_CustomRaycast script to the PlayArea and to set Trigger Interaction to "Ignore."

However, the default behavior VRTK should not be to respond to triggers like normal colliders. The trigger setting on colliders is a way of turning off physics collisions while still receiving the triggered events upon collision.

bug waiting for feedback

All 13 comments

Not sure I understand the issue.

What do you mean it generates a physics response?

If you go into the 017_CameraRig_TouchpadWalking scene and set one of the walls to a trigger collider then you can pass right through the wall without any physics collision resolution occurring, which is what I would expect to happen.

Confirmed with a box collider in my own scene, was able to reproduce by trying it with the sphere in 017_CameraRig_TouchpadWalking.

You're not saying what you're able to reproduce. Please provide clear instructions of the issue and how to reproduce

Sorry, I assumed it was clear from context:

Environment

  • commit cf205d275045f78fecf9fa3571cb787da3574d72 (HEAD -> master, origin/master, origin/HEAD)
  • 5.6.1f1
  • Vive
  • SteamVR

Steps to reproduce

  1. Open 017_CameraRig_TouchpadWalking
  2. Set "Sphere" GameObject's Sphere Collider IsTrigger to true
  3. (Optional) Remove Mesh
  4. Enter Play Mode
  5. Walk to spheres location

Expected behavior

No Physics collisions or location modifications occur.

Current behavior

Position is adjusted to be on top of the Sphere Collider

RIght you're saying you're teleporting on top of the trigger collider because of the body physics snap to nearest floor setting?

It seems like that's the case, though my familiarity with the framework is modest at best.

What I can say for certain is (as described by original reporter :+1:) if I create a VRTK_CustomRaycast with triggerInteraction set to Ignore , and assign that to VRTK_BodyPhysics's customRaycast the (presumed) errant behavior no longer occurs.

Ok now it makes sense, yeah I'd agree with the original comment that the body physics ray casts for checking on locations to snap to the floor should ignore trigger colliders by default. It shouldn't need the CustomRaycast as well.

I'll mark this as a bug.

Has this been fixed? Ive just updated the code from github master, however im still having the same issue :(

Anytime i walk into a trigger zone, i just rebound off it with a small fade to black and rewind taking place?!

I even tried the work around the poster recommended in 1st post:

There is a workaround, and that is to add a VRTK_CustomRaycast script to the PlayArea and to set Trigger Interaction to "Ignore."

Even that did nothing for me :(

The only way i could find a way to walk through trigger zones was to add the trigger zones with a Ignore Raycast Layer, and then in my playArea under the Policy List, i add the IgnoreLayer to the Layers Ignore list!

Is this the correct way of doing this?

The fade to black will still trigger at the moment because the headset collision script still detects trigger colliders. You can ignore objects from trigger the headset collision with a policy list, but i think an option on the headset collision script to ignore trigger colliders is a good idea.

However, the latest version of github master should no longer bounce you back.

You can try it yourself by opening the example 017_CameraRig_TouchpadWalking and turning one of the red wall colliders to a trigger collider, you'll then be able to walk straight through them (but the headset will still fade because of what i mentioned above).

Actually it looks as if the headset collision triggers, the position rewind will also trigger. I have a fix, await a PR :)

OKay thank you, its really late here in uk so i will give this a go tomorrow night after work. For now i did a work around by applying a tag to the trigger zones and then setting the tag to ignore in the policy list of the play area. This seemed to work nicely! Is there any draw backs to this solution or should it be fine?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

thestonefox picture thestonefox  路  3Comments

dantman picture dantman  路  4Comments

broehl picture broehl  路  8Comments

thestonefox picture thestonefox  路  7Comments

cameronoltmann picture cameronoltmann  路  6Comments