Kentae
Member
So I'm making a game where I'm using quaternions to handle a spaceships orientation in 3D space. I'm using some quaternion-scripts that I found some time ago made by TheSnidr. So far I have been able to use these scripts to get the ship to rotate like I want it to, by using the mouse, the Q-key and the E-key to rotate it, Much like the rotation in Space Engineers.
However I am a bit stumped as to how I can use these scripts to make the camera stay behind the ship at all times. At first I thought I could just use the orientation of the ship and add a value to it to make the camera stay behind it but that didn't quite work the way I wanted.
I guess my question here is;
Is there a way i can use the ships orientation quaternion to make a camera stay some distance behind the ship at the right orientation?
However I am a bit stumped as to how I can use these scripts to make the camera stay behind the ship at all times. At first I thought I could just use the orientation of the ship and add a value to it to make the camera stay behind it but that didn't quite work the way I wanted.
I guess my question here is;
Is there a way i can use the ships orientation quaternion to make a camera stay some distance behind the ship at the right orientation?