👻🇳🇱Michael👻
Normal10mo ago
74 replies
👻🇳🇱Michael👻

Cant destroy object

I have a boss object that i instantiate with the following code:

using Normal.Realtime;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class SpawnBoss : MonoBehaviour
{
    #region Variables
    [Header("Variables")]
    [SerializeField] private Transform spawnPoint;
    public string bossName;


    #endregion

    private void OnTriggerEnter(Collider other)
    {
        if (other.CompareTag("Player"))
        {
            Realtime.Instantiate(bossName, spawnPoint.position, spawnPoint.rotation);
        }
    }
}


But when i try to destroy it with a Realtime.Destroy i get the error in the attached image
image.png
Was this page helpful?