I don't understand why this isn't compiling -_- The compiler says "type or namespace PlayerCamera cannot be found" on the PlayerCamera cameraScript line.
(comments are locked)
|
|
If the PlayerCamera script is javascript, you will need to put it in the correct file directory. If PlayerCamera is C#, put it in the same folder as this script. Here's the documentation about compilation order
Sep 30 '11 at 08:52 PM
Bunny83
This one is a better solution (IMO) before Unity added the compile order: http://www.chrisdanielson.com/2011/04/22/unity-3d-javascript-and-c-scopingcompiling-issue/
Sep 30 '11 at 09:02 PM
J3 Gaming
(comments are locked)
|
|
Don't put quotes in the type specifier; you meant this: I edited the question with your fix.
Sep 30 '11 at 05:24 PM
zachypin
Try to avoid posting comments as answers please: it messes with the search system and can give the false impression that the question was already answered
Sep 30 '11 at 05:52 PM
SilverTabby
(comments are locked)
|

Instead of:
use
I don't know why the dot is needed either, but it seems to work for me
hmm that doesn't seem to work. the error I get now is "Unexpected symbol '(', expecting 'identifier'"
That doesn't make much sense. I guess you meant the UnityScript syntax for generic parameters but the dot have to go in front of the generic brackets, not behind them.
Besides that the question title clearly states C# as language so the syntax it absolutely right. The compiler just can't find the type PlayerCamera so it's not there, is misspelled or as MightyGoob said if PlayerCamera is not a C# script you have to put it in a compilation group above the script from which you are using it.