for your game description. please use english.
Script For camera that follow the character :
public class cameraFollow : MonoBehaviour
public Transform player;
public GameObject LevelStart;
public GameObject LevelEnd;
// Use this for initialization
void Start ()
min = LevelStart.transform.position.x + 12.7f;
max = LevelEnd.transform.position.x - 12.7f;
// Update is called once per frame
void Update ()
//The camera's x position is following the player and add space for the player to see what's coming next
CamPos = player.transform.position.x;
gameObject.transform.position = new Vector3(Mathf.Clamp(CamPos, min, max), gameObject.transform.position.y, gameObject.transform.position.z);
Log in with your itch.io account to leave a comment.