When rotating a 3D airplane left or right on the X-Z plane, I want to tilt it around the Z axis. he

inputX;  //left and right input values


// Rotate left/right based on the y-axis
transform.Rotate(0, -inputX * angularSpeed * Time.deltaTime, 0);


// Tilt left and right based on the z-axis, which is the forward direction on the x-z axis
transform.rotation = Quaternion.Euler(0, 0, -inputX * rotationAngle );

… I entered these two things in a row, but they don’t work at the same time; only one of them works;;

If you go left, lean left

If it goes to the right, please help me tilt it to the right.

Here’s my reference ultra-simple flight control script… the rotational bits around line 78, and full functioning scene in the project itself, in this repo:

If you want some “real” flight controls, this is an awesome repository, and one I use in my Pilot Kurt game:

Discussion video: