Hello everyone, Im trying to rotate a Cannon of a ship for aiming adjustment. I tried first using the eulerAngle adjustment but it didn't work, the whole angles and quaternion still confuses me. :(
here's my current code:
public Transform leftCannons; // the actual cannon
public float leftCannonAngle = 0.0f; // the rotation of cannon
//On GUI area
leftCannonAngle = GUI.VerticalSlider (new Rect (250, 5, 10, 50), leftCannonAngle, 0.0f, 10.0f);
leftCannons.transform.Rotate(Vector3.forward, leftCannonAngle);
as you can see in the code i want to limit the rotation of the cannon between 0 deg and 10 deg of the z-axis.