I am triyng to make a space exploration game, i want to use the mouse controls to turn the ship, the same sistem used in games as BattleStarGalactica Online, in which the position of the mouse in relation to the center of the screen is used to make the ship turn.
I tried making that, but commands like “Input.mouseposition” are really tricky for me to completely understand, and once i use them there is the problem of triyng to redirect the origin of the mouseposition vector2 to the center of the screen.
I already have done the trust forward and backwards :
public class NavigationScript : MonoBehaviour {
public float translation = 0F;
void Update () {
if (Input.GetAxis ("Mouse ScrollWheel") > 0)
{
if (translation <= 0.5F) {translation+=0.1F;}
}
else if (Input.GetAxis ("Mouse ScrollWheel") < 0)
{
if (translation >= -0.4F) {translation-=0.1F;}
}
transform.Translate(0, translation, 0);
}
}
I am still a beginner, can anyone help me, or at least give me some tips(or even one good tutorial), in making this turning algorithm (in C# plz) ?