- Home /
The question is answered in the comments
Error message, HELP!!!
"Can't add script : Can't add component 'PlayerController' because it doesn't exist. Check to see if the file name and class name match." This is the error i get when i try to apply a script to a game object, please help as i am an beginner! Thank you!
I have an error... I do not know what it its nor should i tell you because i have an error... fix this error for me for it is an error and i need it fixed because i have an error. now fix it for me... now!?
you clearly have a lot to learn... in order for us to help you , you really do need to add some detail... such as what the error says.. what you are doing.. information the the script you are attaining(if you wrote the script.. code is usually very helpful to identify errors).
based purely off an assumption on reading your description it sounds like a class name and file name doesn't match or "playerController" script has been deleted from your assetes... check both
And did you read the error message and did what it said? "Check to see if the file name and class name match"....?
I had this same error. Thank you tanoshimi for an extremely clear and concise answer to an extremely clear and concise question.
Answer by tanoshimi · Jun 08, 2014 at 03:46 PM
You look for the file name called PlayerController, and you see whether the class it contains is called PlayerController...
When you say if i did what it said when it asks if i have checked to see if the file name and class name match" I can't do so because i wouldn't know where to look. And Fornoreason, when i ask my questions i don't simply demand a fix to it, i am just asking what the origin of the issue is and what causes it and what i need to look for.
Hi, Which is the class then in this script example because I can't figure out what to title it to get it to work. Thank you
using UnityEngine; using System.Collections; public class ExampleClass : $$anonymous$$onoBehaviour { public Transform other; void Update() { if (other) { Vector3 forward = transform.TransformDirection(Vector3.forward); Vector3 toOther = other.position - transform.position; if (Vector3.Dot(forward, toOther) < 0) print("The other transform is behind me!"); } } }
Follow this Question
Related Questions
Tracking Down GUI Errors 0 Answers
Null Reference Exception Unless Scripted Object is Selected 1 Answer
2D toolkit scripting error - Very Basic Stuff 1 Answer
how to set Object reference to an instance of an object 1 Answer
Script Error!! 1 Answer