Space/Aircraft rotation
I trying to create correct rotation of plane with mouse position screentoworld point. Now is not spinning when it rotate up or down to 90°, but when rotate 180° again something wrong. Can someone help with this?
aim = Input.mousePosition;
target = cam.ScreenToWorldPoint(new Vector3(aim.x, aim.y, 200));
Quaternion rot = Quaternion.FromToRotation(Vector3.forward, target);
transform.rotation = Quaternion.Slerp(transform.rotation, rot, rotspeed * Time.deltaTime);
Comment