Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
var Monster = ccbGetSceneNodeFromName("soldier1"); I tried: var Health_Level = Monster.health; //Error: Undefined. and var Health_Level = soldier1.health; //Illegal Character and var Health_Level = Monster.health; //Illegal Character print("Health Level: " + Health_Level); All three method doesn't work, how does it actually work ? Thanks ! And if you are able to answer that, how do you do a health bar on top of the character following it ? |
||||
|
Hi bracer, In order to be able to verify I guess you need to add a sign before the object. You may check the special variables section http://www.ambiera.com/coppercub... |
||||
|
Monster.health //illegal Character soldier1.health //Illegal Character It's not working techno-valley, but I appreciate your attempt to help. So to summaries: var Monster = ccbGetSceneNodeFromName("soldier1"); I tried: var Health_Level = Monster.health; //Error: Undefined. and var Health_Level = soldier1.health; //Illegal Character and var Health_Level = Monster.health; //Illegal Character and var Health_Level = Monster.health //illegal Character and var Health_Level = soldier1.health //Illegal Character print("Health Level: " + Health_Level); ALL not working :-( |
||||
|
It doesn't work like that. You only need to use that text as variable name, it is like a virtual variable. Like this: // note: the forum deletes the hash, so this must be the first character in the name Also, bracer: Would you mind to use shorter titles for your forum threads? This one is nicer already, but your older ones where quite long! |
||||
|
Thank you so much erik. It works now, I am updating my own documentation of CopperCube. Erik, I am not very good at summarizing my questions, I am not very smart. |
|