Hello
Im doing a plane controller in CSharp, it rotate the plane up and down, right and left
The strange thing is when i write
transform.Rotate( Input.GetAxis(“Vertical”), 0.0f, Input.GetAxis(“Horizontal”)
the control is totaly messed up !
It rotate the plane up and down when i press the left and right button
And so it rotate left and right de plane when i press up and down
So i had to change the code to this
public class Controller : MonoBehaviour {
// Use this for initialization
void Start () {
Debug.Log("controller script added to :" + gameObject.name);
}
// Update is called once per frame
void Update() {
transform.Rotate( Input.GetAxis("Horizontal"), 0.0f, Input.GetAxis("Vertical") );
}
}
This code came from this guy,
actually a very good tutoriel, and yeah im totaly noob in C and other coding stuff so i had to find this trick myself and im asking myself why i had to do that
And what is this 0.0f in the middle of the code ?
transform.Rotate( Input.GetAxis(“Vertical”), 0.0f, Input.GetAxis(“Horizontal”)
I think Vertical and Horizontal are like some kind off a call to the controller, something coded in the unity engine…
Dunno its very strange
Have a nice dev day