|
i have a health bar script, and i made a static variable in it. i made it so a monster follows the main character. The monster's code also has a static variable. In the main character's code, i want to make it so when the monster hits it, it does the health bar's static variable minus the monster's static variable. the health bar's script is called bar, and the monster's script is called beholder. here's the code for the character:
everything else works, but unity says that the identifiers beholder and bar are unknown...
(comments are locked)
|
|
"beholder" and "bar" are not the names of your classes. (That is, they are not the names of the scripts.) The naming convention in Unity is to use uppercase for the first letter of a class's name. So here is what you would use in the script you posted:
And in those scripts, named Bar, and Beholder, respectively, you need these declarations: thanks, i didn't know that
May 22 '10 at 08:27 PM
oz m
it didn't work.
May 22 '10 at 08:31 PM
oz m
actually yes it did now, thanks
May 22 '10 at 08:47 PM
oz m
useful to me too - thanks
Dec 04 '10 at 05:03 PM
schwertfisch
(comments are locked)
|
