C# script issues


I just started the Delivery Driver lessons, but when I create the C# script, if I rename it “Driver” (or in any other way) I can’t add it to the Character sprite, both by dragging it and by “add component” button. I don’t know why. If I don’t rename it, I can add it with no problem.

Please help,

Hi Eugandini,

Perhaps the script’s class name is causing the problem. The file name and the class name must match. When we change the file name of the script, the class name does not automatically change. We must change it manually. Here is an example:

Note the file extension (.cs) is not included in the class name.

I hope that helps!


This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms