I need to assign the position of the gameObject "Player" to a variable where its position is stored and then increment it, here is an example:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class first_play : MonoBehaviour {
//Creo que asi se guardaria la variable
Transform posicion = gameObject.transform.position.x;
void Start () {
//Aumentara el valor x (horizontal) hasta que llegue a la posicion -500 de x
while(posicion != 500){
posicion++
}
}
void Update () {
}
}
The assignment of the variable is done in the start, since the components have been started, and the increase is done in the update...