Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Help with CopperCube
Use variable in javascript

mark221
Registered User
Quote
2023-01-07 12:19:17

Hello, and happy new year!

I have this problem, i set and change a variable called totalEnemy in my scene behavior, in the behavior "every few seconds do something".

I would like to know if I can access this variable in javascript so I can use it ?


just_in_case
Moderator
Quote
2023-01-07 12:23:15

yes, you can use the javascript command,
ccbGetCopperCubeVariable("totalEnemy") 
to get it in javascript., you can also set the variable that way, just go through CC Javascript documentation to see the available commands list.


mark221
Registered User
Quote
2023-01-07 12:34:58

thanks,

it works. It was to try to figure out why my cloned enemy share the same health as the original, because when I kill a clone, the original and all other clones die at the same time. I searched on the forum, but I'm not sure I understand. Although I'm sure this subject was brought many time before.
I don't know I'm gonna search again.

Edit: I'm gonna create another tread to ask for my problem. Thanks for solving this one.


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Int?rnational" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact