Prefab instantiates with its components disabled

public class DeathCheck : MonoBehaviour
{
public GameObject paintBall;
public GameObject expEffect;
public GameObject newPlayer;
public AudioSource splatSound;
public Transform shotPoint;
public Transform spawnPoint;
public float ExpDeviation;

    // Update is called once per frame
    void Update()
    {
        if (Input.GetButton("Fire1"))
        {
            Death();          
        }
    }

    void OnCollisionEnter2D(Collision2D collision)
    {
        if(collision.gameObject.tag == "Deadly")
        {
            Death();            
        }
        
    }

    void Death()
    {
        Destroy(gameObject);
        Debug.Log("Boom!");
        splatSound.Play();

        //Creates 20 balls with random rotations
        for (int i = 0; i < 20; i++)
        {
            float dev = Random.Range(-ExpDeviation/2, ExpDeviation/2);
            float rotZ = i * 18 + dev;
            transform.rotation = Quaternion.Euler(0f, 0f, rotZ);
            Instantiate(paintBall, shotPoint.position, transform.rotation);
        }

        //Explotion Effect
        Instantiate(expEffect, shotPoint.position, transform.rotation);
        Respawn();
               
    }

    void Respawn()
    {
        Instantiate(newPlayer, spawnPoint.position, Quaternion.identity);
    }
    
    
}

Prefab’s components are enabled


All the clone’s components are disabled

This thread explains what the problem could be. I can’t test it now but I’ll update this comment when I do

https://forum.unity.com/threads/instantiating-a-prefab-makes-disables-all-components.278471/

Prefabs can have their components etc enabled on the surface but if you go into the Edit of the prefab they can be disabled there and that’s the state they will enter the game.
Double click the prefab to edit and check there.

For me, this happens when I think I drag-n-dropped a prefab reference to the field from the project hierarchy, but instead dragged it from the scene hierarchy.


It’s very subtle thing, prefab changes propagate to the object and it seems identical in the Inspector, unless you click on on prefab field to see which one it highlights.