Satisfying catch and toss mechanics for Touch?

This really applies to anyone developing for Vive also.

I’m curious about how to approach creating satisfying catch and toss mechanics using physics. Mostly toss. I’m working on a prototype and have yet to get something that feels good.

Specifically, I’m trying to toss items into a box. Simple mechanic. But it doesn’t feel right. I’m tossing physics meshes - simple collisions with a center of mass set to default. I’ve tried playing with MassInKG, but oddly don’t find that it has much of an effect. The problem I’m having is the I can’t get ‘feel’ right - I seem to toss too short or too long (way too long!), I’m really not getting a sense of real world physics.

To those who’ve tackled the challenge, what settings did you play with. How should I be approaching this?

Thanks!

Hi Ian,
can you share a bit more about how you do the toss? How do you apply a force to the item you are tossing? I guess a screenshot of your Blueprint/code would help to clarify what might be wrong with the physics.
Cheers,
Marco.

Hi marco,

Thanks for the reply. I’m just using the default motion controller BPs from the VR Template (v 4.14). From what I can tell, this is all that is happening in the script for the toss:

The object itself that I am tossing is a BP Mesh with a projectilemovement component. By the time I catch the item, I’m assuming the settings within the projectileMovement component no longer apply. These are the physics settings within the mesh component:

73f2d33081736f6208921e977c974c8fef1260ed.jpeg

I think that should be everything that is affecting the toss. Is there BP scripting I can do to provide more control?

Hi Ian,

I think you need to revise your logic a bit. When you pick up something with the controller you turn off its physics and then attached it to the controller mesh so you can carry it around. When you drop it, you simply turn the physics back on and then detach it from the controller (this is what the Blueprint above does). In this way you let it go. The result is that gravity will act on the object you are releasing. The object will simply drop to the floor, but this is hardly any toss!

If you want to toss the object, what you need to do after you have reactivated the physics and detached the object from the controller mesh is to add an impulse to it with AddImpulse (Add Impulse | Unreal Engine Documentation). To do so you may have to cast your projectile to a Primitive Component otherwise you may get a compilation error. The direction/magnitude of the impulse to add the the object (projectile) can be always the same or, more realistically, can be derived from the direction/speed of movement of the hand mesh at the moment of release, so you will be able to toss longer or shorter and in different directions as well.

The fact that you are using a projectile may have misled you a bit. A projectile has an initial velocity applied to it, but only at the moment it is spawned. If it is already spawned, like in your case because you are picking it up from somewhere in the level, no velocity is applied at the time you detach it.

Give AddImpulse a try and see whether this gets you closer to what you have in mind.

Cheers,
Marco.

Thanks, Marco!

Unfortunately, I’m more confused than ever. The thing is: with the setup I posted above, the meshes aren’t simply falling to the floor. I am able to toss them (and it actually works pretty good - just not as good as I’d like). So the physics system must be recognizing initial velocity when the physics set to simulate.

Now, addImpulse would probably still be helpful to help me finesse the feel, but I haven’t been able to get it working. This is how I added it:

I added the multiply node just to test to see if it was working. The impulse isn’t affecting my actor. The toss is working exactly as it did before I added the impulse.

So indeed the physics engine must already be applying some initial velocity to the object once you let it go, but it is strange that AddImpulse doesn’t do anything to it. Did you try to give a specific mass to the actor you are tossing? What happens if you make its mass much bigger or much smaller than the default one?

I did some tests in UE4 and I was able to put together a simple coin toss simulation.

Just check the magnitude of the impulse you are applying in relation to the mass of the object. Even for apparently small objects you would need a quite large impulse. A tiny impulse in relation to the mass of the object will have no apparent effect. If you want to make the toss even more realistic, you can use Add Impulse at Location and feed the Location pin with a Unit random vector. In the case of a coin that makes the toss more realistic because each time if flips in a different way.

Hope this helps!

Cheers,
Marco.

Here is one I set up as a cornhole game in an arch viz project Arch viz demo - YouTube
The mesh collision was what I messed with the most. I used a sphere for the pickup that was big enough to make then easy enough to play catch with.