You have a problem. UFOs do not fly just by moving through the space. They usually rotate around themselves while moving in the different directions.
Now, we are going to add rotation capabilities to this 3D character.
protectedvariables. (The UFO has to keep track of the rotation angles and it has to rotate at certain speeds, both defined for each axis):
// The rotation angles protected Vector _angleDegrees = new Vector(0, 0, 0); // The rotation speed for the three axis protected Vector _rotationSpeed = new Vector(10f, 5f, 0f);
publicmethod to calculate the UFO's rotation angles taking into account its rotation speed ...