How to make a rolling cube

I’ve been struggling to create this “rolling” cube in Unreal:Cube Motion Example in Unreal Engine 4 (UE4) - YouTube

Only Left/Right with input

I’ve already setup my input but when I press a key, nothing happen

Thanks.

Please share your blueprint.

The general idea is to handle the events associated with the left-right movement inputs within your BP. It involves rotating the cube along a custom pivot. By default the pivot will be at the centre of the cube which won’t give you the right behaviour. So you should rotate along the correct edge (left edge for rolling left and right edge for rolling right).

This post has more info:
https://answers.unrealengine.com/questions/39470/view.html

Make sure that cube is pawn and it is possessed by player, or it can revive input.
Biggest challenge with cube rolling is calculating edge (ie. point of rotation) and rotation angle. That is some weird vector math (with some vector rotating).

**OlivierTrudel28, did you fin a way to have your cube tumbling? Just curious since I’m looking for the same thing. **

Would be great to see the tutorial for this. Not sure, but are those BP nodes all it takes to do something like this? Does it only work for cube object?