private float xOffset; //Offset of the camera // Use this for initialization void Start() { //Find the player player = FindObjectOfType <SVPlayerController>(); //Set the offsets yOffset = -bottomBorder.transform.localPosition.y; xOffset = leftBorder.transform.localPosition.x; //Set camera to start position moveTo = new Vector3(player.transform.position.x - xOffset, player.transform.position.y + yOffset * 0.9f, transform.position.z); transform.position = moveTo; }
// Start is called before the first frame update void Start() { player = FindObjectOfType <SVPlayerController>(); InitBorder(); }