OK. This is my first Unity project and I’ve gotten pretty far, but as I was trying to implement my newest feature, I found that I couldn’t add the object reference from the scene to the inspector and I can’t figure out why it stopped working. I’m beside myself trying to figure out what is broken.
For a bit of context, I am trying to activate a token when I play a card. I have a script referencing a MirageToken object and I have a MirageToken prefab with a MirageToken script added as a component, but I can’t drag the instance of the MirageToken prefab from the scene to the inspector where it’s asking for a MirageToken object. It will let me add the prefab object to the inspector field, but I want to use the specific instance in the scene hierarchy. Here’s my code where I set up the MirageToken reference:
`using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using DG.Tweening;
public class CardEffectLibrary : MonoBehaviour
{
public Card ThisCard;
public Tile ThisTile;
public GameManager gm;
public GameObject LeechTokenPrefab;
public MirageToken mirageToken; // etc…`