Beispiel #1
0
 // Update is called once per frame
 void Update()
 {
     //moves the position of the hero to match the x = -5 position on the camera
     x = gameObject.GetComponent <Transform>().position.x - 5;
     y = hero.GetComponent <Transform>().position.y;
     hero.GetComponent <Transform>().position = new Vector2(x, y);
 }