Error: The variable player of playerFire has not been assigned.
I had draged and droped FighterMedium(FBX) to the player property. But it saws me the error of upside you can see. Watch the picture for more information.
And here’s my code-
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class playerFire : MonoBehaviour
{
public GameObject selfobj;
public GameObject player;
void Start()
{
transform.eulerAngles = new Vector3(0, -90, 0);
transform.position = new Vector3(player.transform.position.x, -1.1f, player.transform.position.z);
}
void Update()
{
transform.Translate(1, 0, 0);
Destroy(selfobj, 5);
}
}
Can you help me why this error is causing? You can ask me for more information.