So problem is I have room and I go to room with four game objects called StartPoint, how do I choose which start point player will spawn ?
There is my script for player start point:
using System.Collections;
using UnityEngine;
public class PlayerStartPoint : MonoBehaviour {
private PlayerController thePlayer;
private CameraController theCamera;
public Vector2 startDirection;
// Use this for initialization
void Start () {
thePlayer = FindObjectOfType ();
thePlayer.transform.position = transform.position;
thePlayer.lastMove = startDirection;
theCamera = FindObjectOfType ();
theCamera.transform.position = new Vector3 (transform.position.x, transform.position.y, theCamera.transform.position.z);
}
// Update is called once per frame
void Update () {
}
}