Unexpected behaviour 'Relative Rotation' beyond 90 degrees

I have a robot, and when buttons are pressed the joints should rotate on Y axis.
I’m using the add relative rotation command, with a branch node which checks between constraints I have set. ( <= & = > values for -160deg and +160) which I’m getting the Y rotation value from ‘get relative transform’.

When the angle gets to 90 degrees I’m getting odd behaviour. Sometimes the robot arm gets stuck at 90deg and jitters in place, other times it’s get’s stuck, then seems to act as though the axis has been flipped.

Just wondering if there is some inherent issue with relative location passed 90deg, or 180deg overall, as it maybe?

I don’t know how to solve your exact problem but i have 2 thoughts

  • are you sure that rotation goes negative? i’m new to unreal but i would assume rotations are 0-360 and then wrap around again

  • doing a .01 second delay on a loop in a blueprint to animate the rotation janky af! consider setting a “target rotation” variable in the rotate event and then lerping to it on the tick event… or something else idk as i said i’m new but i am pretty sure doing what you are doing is very non-standard

Hello @MattSug
emmm I’m also not sure what are you doing, but I think is easier to create animations and play montages or from animbp blend by bone…

There is a content full of robots, take a look how they did, I’m sure It helps a lot:

Thanks for your reply. I’ve been playing around with the parts manually in the component viewport, from what I can see when I rotate a static mesh beyond -90degY;
-100degY becomes -80deg and x becomes 180deg and z becomes -180deg.

Manually adjusting Y beyond +90deg, it remains positive.

I’m wondering whether this has something to do with relative rotation and hierarchy.

Ah also I see something is not going to work never:

This is what I’m working on, hopefully it will provide a bit of context.

At the end of the clip you can see the jittering behaviour of the arm. https://www.youtube.com/shorts/kQ6lRcBGz4c

1 Like

give 5 min

robot

More much easier than you think, isn’t @MattSug ?

the timeline is nothing special, just float and the axis you want:

Thanks for the example. I’m all for making this simpler! however there is no timeline node in the widget event graph. All my logic is currently located in the main menu widget. I am using the on screen widget buttons to control the robot.

I think It doesn’t matter, you are going to use player pawn

This is how far I’ve got.

This is only my forth small unreal project., so I’m quite pleased with the result. Didn’t figure out the rotation issue in the end though.

1 Like

:clap: