How to stop rotation? (RotatingMovement)

How to stop rotation when using RotationMovement?
I tried using “Stop movement immediately” but it does not works.

I want to stop the movement and reset all rotation angles to zero.


The idea is to make it rotate and stop rotating every time I need it.


Does anyone know how to do it?

Thank you very much!!

Hey there @Ivan3z! So I modified your script just a bit so show you how some of these nodes work. If you are just rotating your root you don’t have to update the component for this movement system, but keep it if you need it. Stop movement immediately is used for input based movement components mostly, in our case the rotation rate would stop it on a dime immediately unless you set some form of lerp to slow it before a stop. Then resetting the rotation (if it’s your root) is as easy as using a Set Actor Rotation node.

So this just sets the X rotation to 100, delays for 5 seconds then sets the rotation to 0 stopping it immediately, then delays for 1 more second then sets the actors rotation values back to 0.

Let me know if you have any questions!

1 Like

Hi

Thank you very much for your reply.

I don’t know why this happens but the rotation doesn’t stop.

I tried your code with and without “Set Updated Component” but everything works without changes.

In this video you can see the structure of my actor.

This is a weapon. I want it to rotate when not attached to a pawn.

And I want it to not rotate when it is attached to a pawn.

I think that indeed what is rotating is the root. In this case it is not important for me to rotate the mesh or the entire actor.

But I need it to stop when it’s attached to a pawn.

What am I doing wrong?

Thank you very much!!

Ok, sorry… I found the problem!! I feel like a dumb!! Your code works perfectly!! I forgot to call the “beginPlay” of the parent class of my weapon!!

2

Thank you very much for your help!! It helped me a lot to understand how this component works!!

:sparkling_heart:

1 Like