make a cube to rotate and move at the same time using C++

I have been trying to make a cube to rotate and move at the same time using C++. I have tried the function SetActorLocationAndRotation(). But the cube moves and torates weird. Could you please give me any suggestions. Thank you!