The roll a ball script isn't working
I am following the roll a ball tutorial as I am new to unity. When I try to play the game after doing the player movement script it sais all compiler errors have to be fixed. The bottom of unity sais, "Assets/Scripts/PlayerController.cs(4,14): error CS0101: The namespace global::' already contains a definition for
PlayerController'" I'm assuming I'm supposed to know how to fix it by that message but I have no clue how. I followed the tutorial typing what it said to type. I tried renaming everywhere that sais PlayerController and even deleting it but that just caused more problems.
Answer by ritoban · May 05, 2017 at 02:28 AM
You had 2 scripts called "PlayerController" for some reason, which caused Unity to freak out because it didn't know which one you were talking about (in layman's terms).
Answer by AiluK · Jan 27, 2018 at 04:37 PM
Here's the error: It's the PlayerController script. I've selected Player in the hierarchy window, and when looking in the Inspector window, the scripts part does not have the Text and Win Text there, just Script - PlayerController. There is this error message:
! The associated script can not be loaded. Please fix any compile errors and assign a valid script.
What are compile errors? Please help!
It's fixed. :) I double checked my code against the code in the tutorial (you can find it just below the video box). The attention to detail required is astounding. $$anonymous$$y error was a misplaced" >" for a "=". Just one keystroke wrong and it were ruined - until now! Ok, next video tutorial now...Bye.
Answer by Skeletonking159 · May 04, 2017 at 11:53 PM
After creating a new script and changing some words I eventually got it to work. I'm not even completely sure what the problem was but it's solved now. I even changed all the terms back to what I originally had them as (what the tutorial sais to have them as) and it still works.
What script did you use because i have the same issue
Your answer
Follow this Question
Related Questions
How to make certain collectibles have to be unlocked before being able to be picked up? 1 Answer
The roll a ball script isn't working :(((( 2 Answers
Script seems inactive? 2 Answers
Trying to add an enemy to the Roll a Ball Challenge. Problem with Player code 1 Answer
Multiple in game currencies 1 Answer