Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Help with CopperCube
variable problem.plese help

alireza
Guest
Quote
2020-05-30 12:21:36

I defined a variable in "before first drawing do something" >"Execute java script"> var test=5;

and then for cubeMesh1:
"when key pressd do something" (E pressed) > "is a variable has value do something" > if test equal to 5 > hide scene node cubeMesh1
but when run and press "E" hiding scene node does not work!!!
ccb file:
http://s12.picofile.com/file/839...

steps image:


[URL=http://uupload.ir/]
🔎︎
[/URL]

[URL=http://uupload.ir/]
🔎︎
[/URL][url]www.example.com[/url][url]www.example.com[/url][url]www.example.com[/url]


AnAverageGuest
Guest
Quote
2020-05-30 17:56:05

Test is not a coppercube variable. You defined it in javascript. To fix that simply make a 2D overlay, draw text, type $test$, go to behaviors, every 10ms do something, change overlay text, type $test$. Now put before first drawing do something, set or change a variable, set to 5. Boom, you're done!


Alireza
Guest
Quote
2020-05-30 18:36:50

AnAverageGuest wrote:
Test is not a coppercube variable. You defined it in javascript. To fix that simply make a 2D overlay, draw text, type $test$, go to behaviors, every 10ms do something, change overlay text, type $test$. Now put before first drawing do something, set or change a variable, set to 5. Boom, you're done!

Thank you .You mean coppercube variables are different from JavaScript?


count2rfeit
Registered User
Quote
2020-05-30 19:08:17

why use JS? you can just set the variable in CC...

http://www.mediafire.com/file/0i...


Alireza
Guest
Quote
2020-05-30 21:05:35

wrote:
why use JS? you can just set the variable in CC...

http://www.mediafire.com/file/0i...

Because i think if use js , variable more flexible and we have more option to do


pmax
Registered User
Quote
2020-05-31 09:47:04

here is the command to create a variable with javascript.
ccbSetCopperCubeVariable(varname, value)



Alireza
Guest
Quote
2020-05-31 09:57:54

wrote:
here is the command to create a variable with javascript.
ccbSetCopperCubeVariable(varname, value)

Thanks very much.
I test this and work.
I was involved in this problem for a month and you rescue me



Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "In?ernational" (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