Hello all, i have a problem. When i grab two actor, one for each hand, collisions are disable. How i can active only collision?
not sure what you mean could you draw something out to explain it more?
@Jack100387 Do you mean like when you are holding two swords and you want them to clink one against the other?
Ok, let me be overcritical for a moment. In general in VR it’s a bad idea to limit the movement of whatever is attached to the motion controllers. The reason is that the object may get “stuck” somewhere because of the blocking collisions and you will loose 1) the control of your virtual hand, 2) the perception of where you real hand is in space with the risk to smash it somewhere as you try to exercise enough virtual force to get the hand/object unstuck.
This said, what you can still do is use Overlap Events to detected when the object you are holding in one hand gets in contact with the object you are holding in the other. At that point you can produce a sound (like the swords clinking) or play an haptic feedback on the controllers like it is done in the standard VR Template.
Or you can be creative with Skeletal Meshes and PhAT like in here:
I hope this makes sense.
Thank you for helps!
You can grip things with physics constraints instead of direct parenting… Unlike Unity which has a fixed update physics thread we can’t really do reliable direct velocity control for held objects so that is the best method.
The in engine Physics Handle does just this and multiple people are using it in VR to “physically” hold objects, in the back end it is a physx kinematic actor with a constraint to the held object, then it just sets the kinematic actors location each tick to where you want it to move the object.
I’ll also note that physics based grips are a common feature in many VR games now and that there are multiple ways to avoid disassociation with limbs. Some of the MOST played VR games make use of physically based gripping.
When you disable physics simulation, the object no longer collides with static geometry in your
level because the object is now getting its transform directly from the motion controller to
which it is attached.
If you want to retain the collision, a work-around (albeit a complicated one) is to not disable
physics; instead, set the picked-up object’s linear and angular damping values to a very high
number. This causes the picked-up object to act as if gravity is no longer affecting it to any
significant degree. This prevents it from falling out of the user’s hands and allows the object to
collide with static geometry.
However, the object does not return to its initial position after it has collided with some
geometry. To fix this, you can disable the object’s gravity after you pick it up, and when the
object moves away from its original position, you can simulate gravity in the opposite
direction to make the object seem to want to return to its original position.