VRTK_BodyPhysics does not generate a physics response when the player object collides with a collider set to trigger.
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.
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:
017_CameraRig_TouchpadWalkingSphere Collider IsTrigger to trueNo Physics collisions or location modifications occur.
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.
PR to fix the issue: https://github.com/thestonefox/VRTK/pull/1247
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 :)
@nadimalam try this PR https://github.com/thestonefox/VRTK/pull/1263
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?