How to grab objects in VR while simulating physics and collision for said object?
Hello, I started a project in VR from the VR-template that follows with unreal. I noticed that with attachtocomponent you need to disable physics to be able to grab. This causes the undesirable effect that the item can go through all other objects and can't cause trigger event.
I've tried physics handler, but it's very loose and acts strange like the object just spinning around and doesn't really follow my arm movements well. I've also tried to just set the transform, but then the object falls towards the floor, which I tried to fix with disabling gravity while you hold the object, which helps, but like every second the object lags.
I've searched around, but haven't seen anyone posting a solution that is not a template which does not work anymore for some reason. Is there some way to simulate physics and collision of an object while it's grabbed by your controller? Appreciate any help I can get!
asked Jul 09 '17 at 09:00 AM in VR
Sorry I couldn't help. I made a few tests now in my VR project and it all comes down to setting your Collision Responses properly.
I got an example Pickup that can collide with the World if it is detached, it also collides with other Physic Objects when attached + trigger events in trigger volumes etc.
However, if your Pickup is attached on your MotionController, you will go through static objects. This is the default design choice in Unreal, because the player is free in reality. There are no objects around him. So, if there is a table in VR in front of him, you shouldn't block his hands or the object nor shouldn't you offset the hand. Your player will just lose control.
Back to my example: To make this work you can fiddle around with Collision Responses, but in my case I added a new Object Type called VRGrab in the Project settings under Collision. The Pickup Static Mesh has Collision Enabled (Query and Physics). It ignores most of the other Objects, but it overlaps with WorldDynamic (that's for the trigger events). I also block with other VRGrab objects (block other pickups, so you can grab a pickup and slap other pickups)
Trigger volumes are usually set up like so: Collision Enabled (Query), Object Type (WorldDynamic) and they overlap with every other Object Type. So, if you added the new Object Type VRGrab, make sure your Trigger Volume has checked Overlap with VRGrab.
That's it, these settings will lead to the behavior I marked. Would be great to hear if you can extract this information for your case and report back if you still got any issues left! <3
I have the same problem...
answered Oct 28 '17 at 09:04 PM
I know this is a bit of an old post but hope that it helps with someone else having the same issue.
It seems that using physics constraint instead of a physics handler with a linear breakage of about 100000 or so looks feasible for it to look like you are holding the object as well as the object not able to go through other objects
Follow this question
Once you sign in you will be able to subscribe for any updates here