I am trying to roll a cube in Unreal but I am not able to do it. For visualization purpose I am creating something similar to this : https://www.youtube.com/watch?v=3nFpUDAzysY
For this I attached a URotatingMovementComponent and tried to offset the pivot in order to rotate it.
I have attached the code that does it. But it does not work.
Well assuming the pivot of the cube is in the centre as it is for the Cube in the Shapes menu. A pivot translation of X = 50, Y = 0, Z = -50 should rotate it as you want forwards.
Yeah it should
But when I reset the pivot and position it back after the player clicks the button again it just rotates the cube around the same pivot location as earlier
So I found a tutorial and made a bit of progress but now I am stuck with how to use the timer function.
In the tutorial the person is moving the cube with Move Tween Function. Move Tween is being called in the Start Moving Function inside a Timer. All this is being called in the Event graph
In my code I am also going the same, but when I do my cube moves both in Y and Z Axis. This only happens when I implement the step thing to make the timer execute it in steps. Otherwise the code works fine