Boolean value constantly shifting?

I’m stumped. There is no other areas in the code where bIsRotating is being set. Using Unreal 5.5.4.


Do you anywhere set it to false?

You may have multiple actors running this same code, some rotating, some not. Try printing name of owning actor in that log.

It is initialized in the header as false.

Good point, I haven’t thought of this. Will try that now, thanks.

I’m dumb :sweat_smile:
This was the case. Now I just need to figure out why the actor is not rotating, but that’s not the point of this topic.

Which one? Interactable or not interactable? From this code you are only rotating non interactable.

The interactable actor. I’m building an interaction system in my game and I want the interactable actor to rotate when interacted with.

The interaction itself works but the rotation is not, here’s the rest of it:

And here’s my debug log showing the interaction working:

image

It is technically rotating but gets stuck here:

And here’s the rotation parameters of the rotation component:

I have tried increasing the rotation speed to see if it’s just moving incredibly slowly but that was not the problem. It’s getting stuck.

Try it with set actor rotation(get actor rotation + 0.1);
if get actor rotation > target rotation set actor rotation=target rotation;
then you will know that interpconstantto is not used properly at least.

Thanks. It does seem to be an issue with RInterpConstantTo. I’m not sure what the issue is though, I have used it just fine for similar situations in other projects.

I have figured it out, the issue was that I was setting the rotation “Origin” instead of the current rotation in the interpolation.

Thanks for the assistance!

1 Like