#Does not derive from MonoBehaviour. But it is?

1 messages · Page 1 of 1 (latest)

daring mantle
#

Hi i'm getting this error in 1 of my prefab

Please change the script to derive from MonoBehaviour or remove it from the GameObject 'AchievementDisplay'.
UnityEditor.EditorApplication:Internal_CallGlobalEventHandler ()```

But the script is deriving from MonoBehaviour
Not sure what else could be calling this error?
Cheers
latent root
#

sounds like something may be corrupted/not linked properly

#

But the script is deriving from MonoBehaviour
how are you validating this? the script it's mentioning is an empty string

daring mantle
#

I was in the middle of updating Topdown Engine asset, and had to re-link a bunch of asmdef/asmref and.. yea it's kinda a challenge

latent root
#

sounds like a link was lost and it can't find the class to begin with?

daring mantle
#

MMAchievementDisplayItem : MonoBehaviour

#

And actually currently this class doesn't show up when i do "add component" on the object

latent root
#

have you refreshed/recompiled at some point?

#

are there any compile errors?

daring mantle
#

No. This warning log actually pops up right when i enter play mode

#

Actually take a look at this

using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using MoreMountains.Tools;

namespace MoreMountains.Tools
{
    /// <summary>
    /// This class is used to display an achievement. Add it to a prefab containing all the required elements listed below.
    /// </summary>
    [AddComponentMenu("More Mountains/Tools/Achievements/MM Achievement Display Item")]
    public class MMAchievementDisplayItem : MonoBehaviour 
#

Could it be the #if directive MM_UI is... somehow messing up the UnityEngine namespace usage?

latent root
#

i don't think it's that - it'd be messing up the existance of the entire component

daring mantle
#

Yea..