Hero Script - error - Ch 3 - [Resolved by poster]

I have just created the empty C# Hero script in Assets/Scripts.

The instruction is then to select MyHero in the Heirachy and drag the Hero script to it.

When I do that I get an error - “Can’t add script behaviour VisualContainerAsset. The script needs to derive from MonoBehaviour!”

Is there a simple error I am missing?

I have tried dragging the script to the Inspector but also get a different error.

It’s ok - for some reason I had named it incorrectly in the first place and then renamed it. I realised I had the incorrect class ahem within the file. It now attaches correctly.

hi @darthcolejoy,
glad you could resolve this. I am changing the title so that other readers do not get confused.

cheers,

Jayant

Hi team,
Could you help me on this issue? My hero can walk to the left edge but when he moves to the right, I encounter a blue screen. I don’t know what happen?!bluescreen

@kevinpham1985 Do you still have issues with this?