Files
Scampz/Assets/Scripts/GameManager/PlayerSpawnController.cs
2022-08-20 15:38:13 -07:00

19 lines
452 B
C#

using UnityEngine;
public class PlayerSpawnController : MonoBehaviour
{
public GameObject Player;
[SerializeField]
private GameObject _playerPrefab;
[SerializeField]
private GameObject _spawnLocation;
private void Start()
{
Player = Instantiate(_playerPrefab);
Player.transform.position = _spawnLocation.transform.position;
Player.transform.rotation = _spawnLocation.transform.rotation;
DontDestroyOnLoad(Player);
}
}