Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Item collision v2 - Disable collisions where neccesary #70

Open
3 of 6 tasks
JaXt0r opened this issue Jul 5, 2024 · 1 comment · May be fixed by #81
Open
3 of 6 tasks

Item collision v2 - Disable collisions where neccesary #70

JaXt0r opened this issue Jul 5, 2024 · 1 comment · May be fixed by #81

Comments

@JaXt0r
Copy link
Contributor

JaXt0r commented Jul 5, 2024

Hint: First iteration of this ticket: #88

Background

In G1, when we pick up an item, its mesh will be automatically destroyed (and the item is put into our inventory). There's also no collision between e.g. a sword in our hand and the world. But when we play in VR, gamers should have the option to enable item collisions for (optional) immersion.

Solution idea

  • Remote grab: Check if we can disable collisions from GrabStartEvent until GrabEndEvent
  • Direct grab: When in our hands, the object should become a ghost item without collisions with one of these options:
    • Once item is grabbed, it will stop collisions for a period of time (e.g. ~2 seconds).
    • Alternatively, we can do a Physics.Overlap*() check regularly. If there's no Collider returned, we enable the item for collision again.
    • It might be useful to combine both ideas (e.g. some swords on a shelf in Gomez' warehouse might not collide the first frame(s), but we still can't pull them out of their shelfs except we ghostify them shortly). Please test and decide based on gaming experience.
  • Add a menu entry to enable/disable this feature. If disabled, items in our hand never collide.

Improved ideas are very welcome. 😃

@JaXt0r JaXt0r changed the title Remote grabbing an object should ignore physics until it's in our hands Item collision v2 - Disable collisions where neccesary Aug 19, 2024
JaXt0r added a commit that referenced this issue Aug 23, 2024
… for items in hand once no overlapping collision happens any longer.
@JaXt0r
Copy link
Contributor Author

JaXt0r commented Aug 23, 2024

Fixed within: #81

I tested it with the Physics.OverlapCapsule() and it seems to work fine for all objects. No need for a 2-seconds delay so far. But if needed, we can easily set a Coroutine yield timeout at GUZ.HVR.Components.HVRVobItem.ReEnableCollisionRoutine.ReEnableCollisionRoutine()

@JaXt0r JaXt0r linked a pull request Aug 23, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

Successfully merging a pull request may close this issue.

1 participant