Correct a physics based cube's rotation based on camera rotation using torque

I’m trying to correct the drone’s rotation with torque, I want it to balance out when facing the camera, but it only works when facing one direction. As soon as I rotate the camera it starts spinning out.

This works perfectly with just the yaw plugged in, but roll & pitch mess up despite the delta rotator spitting out the float var that I expect.

I get the exact same problem when attempting to use set linear physics velocity.

The main collision actor here is just a cube collision with the drone as a child of that component.

Gif of the problem
droneFailing

The blueprint plugged into tick

I feel like it’s something obvious that I don’t understand to do with how the engine works out rotations.
I’d really like someone to explain what I’m doing wrong here if possible.
Maybe post a tutorial to explain it or step by step as to what it is I’m missing.

Ok so I’ve looked into content examples & stumbled across the “Rotate vector” node.

I’m pretty sure this is what I need to make the above work, although I’m not sure why or how.

Even if I manage to figure it out, I’d like to know how it’s working the way it does, so if you have this knowledge, please share.

So this got it working, but I don’t know why. I just caveman’d it until it worked.

If you have any idea what is going on here, please inform me.

I will mark the post which can provide information on this as the answer.

1 Like