Timeline for Enable and disable different component on a Gameobject
Current License: CC BY-SA 3.0
17 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Feb 16, 2016 at 9:05 | answer | added | rataplan | timeline score: 1 | |
| Feb 16, 2016 at 9:03 | comment | added | rataplan | Right you are, Hamza....I did close VS, close Unity; open Unity again and double click on the script in Unity, which opened VS again. Now VS is able to see the scripts correctly. | |
| Feb 16, 2016 at 5:29 | comment | added | Hamza Hasan | Did you try to close solution in VS and reopen it manually? | |
| Feb 16, 2016 at 1:05 | comment | added | rataplan | No, everything works fine; the error is raised only when I use one of my scripts,called via GetComponent. Tried with angle bracket and round bracket and with quotes; nothing works. If I enable or disable the script from the Editor, while the game is running, it works just fine. I suspect that something is wrong with VS at this point, because it make no sense....all the posts that I have foumd, use the same syntax; and I get the error on any script, even if I create an empty one from Unity Editor. | |
| Feb 15, 2016 at 18:11 | comment | added | DMGregory♦ | The error has nothing to do with getting a component, that's a red herring. Are you getting any other compile errors that could be preventing the compiler from adding these scripts to its collection of known names? | |
| Feb 15, 2016 at 18:02 | comment | added | rataplan | I should point out that this happen for any script that I add, or for assets that I purchase on the asset store, which use custom scripts. I can retrieve the components that are native in Unity, like Camera or Audio Listener. | |
| Feb 15, 2016 at 18:00 | history | edited | rataplan | CC BY-SA 3.0 |
included the playerscript class content
|
| Feb 15, 2016 at 17:47 | comment | added | rataplan | I didn't mispell it, that was my first thought and I did copy and paste it, to be safe. Adding the file content in the question | |
| Feb 15, 2016 at 17:45 | comment | added | DMGregory♦ | That's the compiler telling you it doesn't know what "playerscript" is supposed to refer to. If you've already eliminated namespaces or other uses that would require qualifying the name, then it could be that you've spelled "playerscript" differently in the class definition (case matters). Can we see an excerpt of the playerscript class? | |
| Feb 15, 2016 at 17:42 | comment | added | rataplan | The error is CS0246 "the type or namespace could not be found. I did check the namespace and I use none. They are plain scripts used as controllers, that interact with my model classes. | |
| Feb 15, 2016 at 17:38 | history | edited | rataplan | CC BY-SA 3.0 |
Clarification on the question
|
| Feb 15, 2016 at 15:36 | review | Close votes | |||
| Mar 3, 2016 at 3:03 | |||||
| Feb 15, 2016 at 11:46 | comment | added | ElDuderino | What's the error message? playerscript needs to extend MonoBehaviour! | |
| Feb 15, 2016 at 11:39 | comment | added | Sturlen |
Are you sure they're in the same namespace or that you've imported the namespace playerscript is in?
|
|
| Feb 15, 2016 at 10:04 | comment | added | Hamza Hasan | For safe side did you try to first turn on your script and get it? | |
| Feb 15, 2016 at 9:53 | comment | added | Hamza Hasan | What error you are getting? | |
| Feb 15, 2016 at 9:46 | history | asked | rataplan | CC BY-SA 3.0 |