Im trying to detect if an object is not active,How to do platform appears when the player dies?

I want to do that if the enemy dies then a platform appears. So when i kill the enemy its disables itself and im trying to detect with this code

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Puzzle : MonoBehaviour
{
    public GameObject Platform;
    public GameObject Enemy;
    // Start is called before the first frame update
    void Start()
    {
        
    }

    // Update is called once per frame
    void Update()
    {
        if (Enemy.activeInHierarchy == false)
            Platform.gameObject.SetActive(true);
    }
}

Its not working :confused:

Im pretty sure checking for activeself is better than activein Hiearchy.

 if(Enemy.activeSelf == false) 
{
   Platform.gameObject.SetActive(true);
 }