I am trying to write the control script for a ship/craft object that will fly around in 3 dimensions in a gravity enabled environment.
I have been having issues with moving the object in global z and y and rotating in the global y while rotating the collider/mesh in the x, y and z independently.
I want to change the collider and mesh x (pitch) and Z (roll) so that the ship/craft object will look like it can pitch its nose up and down and roll the left and right during turns but I want to fully control the z speed, y height and y rotation regardless of the mesh/collider’s angles.
I have considered moving a parent object (with its X and Z axis locked) and having the collider/mesh (and possibly a rigidbody) on a child object. I was hoping I could get Unity to handle the ship/craft collisions, but although it might seem an easier option now, it does make the flight model more complicated overall.
I have found many questions regarding FPS/3rd Party character controllers but not many talking about flight models where you have to deal with x and z rotation.
Can I rotate the collider/mesh of an object with a rigibody, using force in the global z and y (plus rotation in the global Y) and still be able to use Unity’s physics to handle most collisions or should I just use an object with a trigger collider and handle all my own collisions and movements and leave Unity to handle any other game objects with colliders (and rigidbodies where needed)?
My apologies if this question doesn’t make sense, as a noob to Unity (which I am loving), I haven’t got my head around the colliders/rigibodies and movement yet.