I wrote C# script like this but, I got these error....
How can I solve this problem???
using UnityEngine;
using System.Collections;
public class Camera_M : MonoBehaviour {
public GameObject Player;
// Use this for initialization
void Start () {
transform.position = Player.transform.position;
}
// Update is called once per frame
void Update () {
transform.position = Player.transform.position;
}
}
NullReferenceException: Object reference not set to an instance of an object
Camera_M.Update () (at Assets/Scripts/Camera_M.cs:18)
NullReferenceException: Object reference not set to an instance of an object
Camera_M.Update () (at Assets/Scripts/Camera_M.cs:18)
↧