Search Unity

Can't add script behaviour VisualContainerAsset. The script needs to derive from MonoBehaviour!

Discussion in 'Scripting' started by neyu_unity, Jun 15, 2018.

  1. neyu_unity

    neyu_unity

    Joined:
    Jun 15, 2018
    Posts:
    6
  2. neyu_unity

    neyu_unity

    Joined:
    Jun 15, 2018
    Posts:
    6
    First picture im dragging c# file to player folder.
     
  3. Brathnann

    Brathnann

    Joined:
    Aug 12, 2014
    Posts:
    7,188
    Well, the error just says a script you're trying to add doesn't inherit from Monobehaviour, so you can't add it directly as a component to a gameobject.

    If it does inherit from monobehaviour and you are getting this error, restart Unity. I think we had that happen here at work once and restarting fixed it.