Rotating an actor, or, The most trouble I've ever had doing something simple.

Hello folks. As the title suggests, I am attempting to do something that seems very simple in concept, but has been giving me a hell of a time. I have to admit some incompetence here- my approaches may have veered way in the wrong direction. Please feel free to correct me.
**
Objective: Using the X, Y and Z keys as inputs I want to rotate an actor around it’s X, Y and Z axis respectively. They should rotate 90 degrees each key press. **

That’s it. I’d like to be able to figure out how to do this either using local rotation of the actor, or world axis, as I am not sure which will feel right for my purposes.

I’m a novice with blueprints, but my first attempt to make this work looked like this (the Y and Z axis have identical node networks, except referencing the proper axis):
8c9a3c983768b0f0eb72a1ff7edd81c6da8f432a.jpeg

The problem with this approach was I kept running into gimbal lock, or the axis just would rotate in a direction you wouldn’t expect them too. It was very incomprehensible as a game mechanic that the player needs to be able to control.

Assumption: SetActorRelativeRotation was the wrong node to use for this situation.

Attempt #2: I decided to replace the rotation node with an AddActorLocalRotation
c5bb24a4f34015e47630d3b18a59ee087b41bb0f.jpeg
I couldn’t get the timeline curve to work, so I temporarily removed the LERP while I just try to get the rotation to work. This is my first time working with Delta Time, but I tried to read up as much as I could find.

This blueprint no longer gave me gimbal lock issues, and it is much easier to control which direction you intend to rotate the actor. However, now my problem is that the actor doesn’t rotate precisely 90 degrees, but rather some messy amount like 90.345614. As I repeat the rotations, the discrepancy increases. I assume this is because the math that determines the rotation delta is based off of my framerate, which is not constant? (After I solve this issue, I would also like to reconnect the timeline for a smoother rotation, if possible).

So are either of my approaches close to being correct? Or do I need to try some entirely new method? (Hopefully you didn’t notice I spelled 'Increment" incorrectly in my variables =P)

I am not sure on your main problem but I did notice your lerp. I use a lerp rotater for my rotation using the timeline.

Actually when looking at this again, for rotations, you should be using a Rotater variable and a rotater lerp if you are trying to “rotate” your object. Also if you want to use a custom curve, I found a way to do that as well. Just use a Get Float Value and plug your float curve into that and then an external custom curve in as the target. Just make sure the custom curve has the First and Last points matching the times of your timeline curve.

Set actor relative rotation should also be correct.

Thank you for your response Wolfen. Isn’t a rotator node just 3 float values stored in a single node? If that is true, I don’t see a functional difference between having a float variable set to 90 that I plug into the Z axis, versus a rotator node with a value of [X=0, Y=0, Z=90] which I plug in to a rotator pin. In fact, if I ever want to change the value that I want to rotate, the float method lets me change that value in a single place instead of modifying 3 different rotators (As I plan to have a separate function to rotate on each axis).

I honestly don’t know. I am pretty new to BP’s myself. But I had a coworker help me solving some rotater issues (similar to yours) and he had me switch to those rotater values and my problems were pretty much solved. Did you at least try it?