Roll a ball- Keys not working
I just need help with the roll a ball Tutorial https://unity3d.com/learn/tutorials/projects/roll-ball-tutorial/setting-game?playlist=17141 this one right here and mostly likely one after it because im new to coding games and everything i Have followed everything in this video to the very last point i have put screen next to screen to look at the coding and its the same i even try deleting the file and fresh starting two times already!! the main problem is The ball will not move when i hit the arrow keys and the WASD button so any suggestion or help would be amazing thank you!
Hi there, and welcome to the world of program$$anonymous$$g and games!
Unfortunately this isn't really enough information to go on - What have you tried? Can we see the code responsible for moving the ball? Does the ball have an instance of the $$anonymous$$onoBehaviour
in question? Are your inputs set up correctly in the project settings?
As of right now an answer cannot be formulated, but with a bit more information it could probably be easily fixed.
Answer by Matthewj866 · Apr 17, 2017 at 12:47 AM
@Zympho The issue is actually a very simple one - please take a note of the name of the class, and the name of the file. The name of the class is PlayerController
but the name of the file is Playercontroller
. While this issue might seem mundane, you might notice in the inspector that it's complaining the class file is invalid (see your first screenshot, "script cannot be loaded" under the MonoBehaviour
). In regular C# and the .NET framework, this little tidbit would not be a problem, however, Unity manually loads the classes and files independently of Monodevelop and relies on the file name matching the class name exactly.
If you make the names match, it should fix the issue.
Please note Unity cannot compile unsaved changes in any external editor, so ensure you save your changes before trying to build again.
Also, I highly recommend installing Visual Studio 2017, it's much better and is designed for the language.
Hope this helps! And since you're new here, please remember to mark this as the answer if it fixes your problem!
Thank you so much! I know who to go to now if i need help lol I accept the comment so i don't know if that marks the answer or not but thank you @matthewj866
Answer by Zympho · Apr 16, 2017 at 11:18 PM
I couldn't reply to your comment for reason and im getting to the point im done with this and do something else since i can get barely any help starting out but the three picture below is whats going on i tried doing it on my own and the ball wont move and i even copied the code under that video to make sure i got it right and either way it just wont work any suggestion? is my coding wrong? or is it in the input manager setting? because i checked both of them @Matthewj866
Your answer
