ExtendRealityLtd / VRTK

An example of how to use the Tilia packages to create great content with VRTK v4.
https://www.vrtk.io/
MIT License
3.69k stars 993 forks source link

Pointer Facade Positive Rule does not match properly #2041

Closed fight4dream closed 5 years ago

fight4dream commented 5 years ago

Environment

Steps to reproduce

  1. Open ExampleScene
  2. Search for IgnoredTeleportObjects
  3. Rename to TeleportableObjects
  4. Remove the Negation Rule component
  5. Modify the SerializableTypeComponentObservableList to contain a list of only DestinationLocationFacade
  6. Search for PointerRules
  7. PointerRules's RuleContainerObservableList will have a missing element, drag TeleportableObjects into it to relink

Expected behavior

This should deliberately only allow destination point facades to be valid and selectable by pointers.

Current behavior

Nothing is valid and selectable.

thestonefox commented 5 years ago

I think the issue with your setup is you're trying to check for a DestinationLocationFacade but the GameObject which that script sits on never deals with any collision data so the pointer will never find it.

The sub element that has the collision volume on is called Internal/CollisionVolume it has a tag component of DestinationLocationLockedStateTag you could probably check for that.

But then I think this will create an additional issue with the headset surface locator will attempt to find the ground underneath the destination point and this ground won't match the rule so it won't actually teleport you.

I wonder if therefore destination points should have their own ground collider that can be set up with a rule?

But in short, the positive Rule system works fine.

fight4dream commented 5 years ago

After fiddling with it, I confirm the positive Rule works fine.

Here are what I have done to my destination for anyone interested:

  1. Add kinematic rigidbody on destination location facade, also add kinematic rigidbody for its CollisionVolume. because the Rules checks for Collision.transform.gameObject and it will refer to the nearest parent/self rigidbody.
  2. Add a floor collider as a child of your destination location game object.
  3. For pointer rule, check positively for DestinationLocationLockedStateTag.
  4. For teleporter rule, check positively for DestinationLocationFacade.