Random rotations when setting relative rotation. Possible engine bug?

I’m getting weird random rotations when setting exact same rotations.
See video for understanding:

I have uploaded project files of this issue for reproducing.

[MyProjectUE_Bug.zip][1]

Open in EU_4.19.2 and hit play to experience rotation madness…

ScenarioA: It is easy to reproduce:

Create 3 or more static mesh components attached in series (Scene->SM_Child01->SM_Child02->SM_Child03) then set relative rotations of around 270 to to all SM components.
Range from 269.99 to 270.01 gets very weird results.

ScenarioB: Also this bug seems to appear when setting exact same rotations to static mesh actor which is descendant of ~8 actors. See attached picture:

Rotating this set of descended actors seems to get random results.

Could anyone explain this behavior? I think that rotation values are calculated inaccurately or something like “gimbal-lock” occurs?

Only workaround for this issue is to not use more than 2 descended children. (MainActor->ChildActor01->ChildActor2)

Seems like you are another victim of gimbal lock. I suppose you should stick to your workaround not to use more than 2 children or, even better, use vectors to set the rotation. You seem to use only right angles so it is going to be easy to calculate them (GetForwardVector, GetRightVector, GetUpvector).

It does handle such corner values (89.99-90.01; 269.99-271.01) of rotators when applied to 2 of the roll/pitch/yaw for a long chain rather badly because of small floating point errors and gimbal lock. I had the same problems when I worked with rather complex rotations but I managed to solve it using vectors.

So I strongly suggest you having a look at vector arithmetics. Mostly, I think, because it helped me in the past, but it might help you too so it may be worth trying

Workaround is time consuming task, and limiting project greatly, but would do the job. Also it is(?) shame that UE4 isn’t capable of handling child hierarchy rotations when having 3 or more children. ScenarioA might be this gimbal problem, but ScenarioB probably has nothing to do with gimbal lock, because I tried to use Quaternion rotations instead of ever using Rotators – still the same problem occurs.

Hello,

We’ve recently made a switch to a new bug reporting method using a more structured form. Please visit the link below for more details and report the issue using the new Bug Submission Form. Feel free to continue to use this thread for community discussion around the issue.

https://epicsupport.force.com/unrealengine/s/

Thanks