Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
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] |
||||
|
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! |
||||
|
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? |
||||
|
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 |
||||
|
here is the command to create a variable with javascript. ccbSetCopperCubeVariable(varname, value) |
||||
|
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 |
|