Objective: Pressing Z key causes a specified actor to rotate exactly 90 degrees about its Z axis using the AddActorLocalRotation node.
I am new to using DeltaTime and the AddActorLocalRotation nodes, but I’ve been trying to read up on them. I have a mostly working blueprint, but it ends up rotating my object something like 90.1560 degrees (different each time).
Am I right to assume this discrepancy is because the delta rotation is computed using my framerate, which is a non-constant value?
More importantly, is there a way to use the AddActorLocalRotation node and still specify an exact rotation amount? The concept of Delta Rotation still confuses me a little…
Delta seconds is for calculate when every real second is reached depending on the FPS
for example: If you have 15 fps the delta seconds value will be 0.0666666666666667 (fps / 1 second)… its mean witch number i have to plus 15 times (fps times)
Using delta seconds you will never see chabges in real seconds if your fps drops down, the delta seconds value changes everytime, because your fps is changing everytime. it will be always relative to your fps and will always be the same time no matter how your fps works
Im sorry, I made a mistake, you dont have to plus the lerp result, here is the right way. And I forgot, in the A pin from the lerp goes the current Z rotation, and in B pin will be the target Z rotation, not the degrees you want to increment, so remember. A current rotation, B target rotation
Unfortunately this didn’t solve my problem, but perhaps I did something wrong.
I had to modify your blueprint, because I want mine to execute off of a key press. I also intend for the object to rotate an additional 90 degrees with each successive key press, so I added some math.
I added the timeline node in just because I didn’t know any other way to make it work (without the timeline, it only rotates a few degrees in an instant).
but my original question specifically asked how to do it with the AddActorLocalRotation node, for reasons I didn’t expand on for the sake of brevity.
When I use the SetWorldRotation or SetRelativeRotation nodes I run into issues with gimbal lock. In the end, the player is going to have 3 buttons, 1 to rotate around each axis (repeatedly). After rotating several times in different directions I run into problems of gimbal lock where I can’t rotate in the direction I am trying to- the AddActorLocalRotation node is the only way I have found to get around this.