Cannon rotation

Can’t figure out how to rotate the cannon on it’s Pitch and Yaw without effecting the Roll.

Well that was kinda short.
According to your image you are adding nothing to roll so what are the results are you getting ?
I’d usually go about this by changing Relative rotation and leveraging LERP (finterp) instead of adding deltas…

this is what it looks like when i move the mouse around a little. it starts to turn on its side.

Are you super-duper-extra-sure that your axes are set up correctly ? I’ve seen this stuff before and it kept happening because I erroneously thought my axes will keep the same setup once imported into UE4. Also you didn’t share what your functions GetLookUp and GetTurn look like, so maybe there’s a logical error there as well.

53638-capture.png

I’m talking about the static or skeletal mesh’s axes, not axis mappings…

Yes, if I remove the getLookup from the AddWorldRotation node the cannon turns side to side. If I remove the getTurn it moves up and down. When added together they change the roll of the object. I believe quaternions are the way to get around things like this but have no idea how to do that in unreal.

This has nothing to do with quaternions. Try using relative rotation instead of world one and double-check your logic inside your functions.

It still rolls with relative rotation. The functions you are referring to are just input axis return values from the input manager. No custom functions of any kind.

Solved the problem by rotating the pivot and the cannon mesh separately. If you add both rotations to a single component it will mess up due to gimbal lock.

It’s great that you solved it, but next time, so as not to waste people’s time, you should really be more informative, the fact your cannon consists of 2 separate pieces is quite a game-changer actually.