Cannot Add Script to Player Ship

When I attempted to drag the Player Controller script onto the Player Ship object, I get this error:

Screenshot 2021-07-08 094446

I get the same error regardless of whether I try to attach it to the instance or the prefab. Here’s a screenshot of the instance in the Inspector:

Any insights appreciated!

Edit: here’s a screenshot of the script:

Might have renamed the script but not the “public class : PlayerController : monoBehaviour”
the script name needs to have exactly the same name as the text there " PlayerController "

check if there is space beteen words in script file

Thanks, that was exactly the problem! I’ve never made that mistake before so it never occurred to me to look for that.

1 Like

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

Privacy & Terms