Can you refer to a prefab in code as a gameobject - they are the same right?
a prefab is a gameobject once its in the scen correct?
I have this code snippet below and my prefab isn’t getting counted in score when its killed is this because the code mentions gameobject instead of prefab?
this code works when on a gameobject in the scene and when I drag the prefab manually into the scene it also works on it but only then
void OnCollisionEnter2D(Collision2D coll) {
if (coll.gameObject.tag == "Enemy")
{
if(canStartCoroutine)
{
canStartCoroutine = false; // after one hit, boolean is made false immediately to prevent it from updating again.
StartCoroutine(WaitToDestroy(waitTime));
}