Forcing physics cube to rotate and stop every 90 degress

Hi everyone,

Hoping to get a little guidance on how to solve this challenge, if it’s even possible.

I’ve got a cube in a blueprint with physics enabled. It’s suspended using a physics constraint. I can make it rotate with an angular impulse on its Z axis just fine, but it’s important that each time I spin it, it only rotates 90° so the side rotating toward the stationary camera ends fully facing the camera, not offset a few degrees either way. I also want it to feel smooth and not come to a sudden stop like it’s hit a limit.

So the flow would be
key press → spin 90° and smoothly stop. key press → & spin another 90° and smoothly stop.

Adjusting the angular dampening helps, of course, but I’d like to get it more exact without it hard snapping to 90°, if that’s possible.

Hoping there’s a solution - thank you for any suggestions!

Hey there @etudenc

It’s hard to understand why you would want to use physics in this situation without more context.
It’s doable, but unnecessarily complicated.

The easiest way is to disable physics and do a rotation interpolation. You can even enable the physics upon Hit if that’s what you want and apply the correct impulse then.

But, if you want to have some sort of dangling thing that you can rotate while its moving, I can think of two solutions.

1 - Have another component be the one with physics and lock its rotation. Make your static mesh a child of this component, and rotate it with interpolation as I mentioned above.

2 - Use a timeline or something similar to “manually” manipulate its velocity so that it accelerates and decelerates at the desired rate/curve to rotate exactly 90º. You can use lerp with a “max velocity” to calculate it based on the time left.

Personally, I would go with option 1 without knowing more about your exact situation.
I hope that helps.

Angular Dampening on the mesh is set to 0.1. You will also need to punch in p.Chaos.Solver.SleepEnabled 0 into the console since Chaos likes to snooooze.


Or switch to the Physics Control plugin which grants more control.

Thanks so much for your input! We wanted the cube to feel “floaty” and be more dynamic, which is why the physics solution works better for this case. I had animated the turning/“bobbing” behavior but then that seemed to mess up properly adjusting a material blend we set up.

Anyways, thanks again for the help!

“Set Angular Orientation Target” - I had no idea that such a node exists, thank you so much for posting this!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.