How to assign a gameobject/transform to a prefab
Hello! I have this problem with my game, where, when I try to instantiate an enemy and turret, the instantiated GameObject will have empty variables,
public Transform target;
public GameObject player;
these will turn up empty in the inspector... Therefore, the enemy and turret won't know what to shoot and what to move towards, and the enemy and turret will just sit there... Is there a way to fix this by attaching the Player in the script, say by using tags or GameObject.Find("Player"); (I tried that it doesn't work, idk why.) The inspector won't let me attach an existing gameObject in the slot... Hopefully you know what I mean and know a solution... Thanks!
Your answer
Follow this Question
Related Questions
memory games 0 Answers
how to pickup and clean the map 0 Answers
Helppp meee about making Cube... Urgent... 1 Answer
Child as pivot's parent 1 Answer