Setting world rotation in actor tick vs actor component tick?


I have a drone that I make fly forward/strafe by using thrusters. To simulate some rolling & pitching forward behaviour I set the rotations manually based on the thrust percentage. This works fine when calling it from the actor/event tick in the blueprint itself.

When I converted the code to C++, I moved it to an actor component that controls all the movement. When calling the code from this tick, the thrusting is messed up & I get very jittery behaviour. When making the function that controls the rotations a blueprint callable, and calling this function from the Actor tick, it works fine again. So:

BP only → OK
Actor tick + C++ Code → OK
Actor component tick + C++ code → Not OK

Is there something about the order these ticks run in important or am I approaching this incorrectly?

Are you using “RotateDroneBasedOnThrust” on every tick? Looks unnecessary to allocate memory on the heap with “USceneComponent* Rootcomponent”. Either save the reference somewhere else or use GetRootComponent()-> GetComponentRotation() and GetRootComponent()->SetWorldRotation directly.

Theoretically should not be any difference :-/