Rotating an actor

I am in the process of making a button that spins when activated. When I try to make it spin, it always jumps back to an original position. This is my code at that point:

I then thought that maybe me moving the object around the world and rotating it so it was against a wall was the problem, so i tried this:

this made the rotation go really fast and I’m not even sure if it was what I wanted. Does anyone know what i’m missing or not doing right? The timeline is a float line from 0 to 360. I just wanted it to rotate around the Y axis over 2 seconds. It sounded so simple…

Hello Ironmonger42,

When the rotation resets on you, that means you’re running into the issues related to Quaternion math and rotation in most computer programs. You can read up more on Quaternions here, but adding a Rotating Movement Component should be able to give you the result you’re looking for without the hassle of needing to do all of that math yourself.

Hope this helps!

This seems to solve my problem, but on the same note how do i make it spin around the center? It’s spinning around the bottom left corner. I can’t get the static mesh to move in the blueprint. Do i need to make the static mesh be centered before it’s imported, or is there a way to adjust the center?

That is correct. The best way to do this would be prior to the import via a 3d modeling program. You’ll need to move the mesh to where the origin is where you’d like your pivot point for the rotation to be.