Pitch and roll movements work fine here. However, when I place the blueprint in Cesium, I need to rotate the aircraft so it matches the direction of movement. However, when I do this the pitch and roll are switched (probably because of change of axis). So my question is: how can I rotate this axis 90 degrees independently of the aircraft mesh? With that, the rotation in Cesium and pitch and roll will work properly.
Hi @FastFishy96,
Just to make sure I understand: are you attempting to use this model with a CesiumGlobeAnchorComponent?
If so, the easiest solution might be to attach the CesiumGlobeAnchorComponent to an empty Actor, and then make the aircraft’s Actor a child of that one. You can apply a rotation to the aircraft Actor to rotate it to standard Unreal conventions, and then the globe anchor will rotate it from there.
Hello. What I think happens is that the pitch and roll and done over the global axis, while they should be done over the local axis. How to change that is a mystery to me (I’m quite new to Unreal Engine).
When they would be performed over the local axis of the aircraft, then this issue should not occur. The problem is that the heading is used for yaw, which should be done using the global axis (the orientation by the Cesium world).
We recently modernized our Flight Tracker tutorial and included instructions for the situation where the plane’s orientation does not align with the flight path:
Depending on the aircraft model you use, you may have to adjust its rotation to align with its movement along the spline. You can fix this by opening the BP_Aircraft Blueprint, clicking on AircraftMesh ( the StaticMeshComponent ), and adjusting the Rotation .
From my understanding, this would be the best way to correct the misalignment – apply the rotation to the StaticMeshComponent so it matches the trajectory of the flight. Then, any transforms on the Actor it is attached to should automatically account for this local adjustment. Make sure that you’re applying the pitch and roll to the actor, and not its mesh component, otherwise you’re overriding the correction that you already made.