≡
Products
▼
Support
▼
Company
▼
Forum
Ambiera Forum
Discussions, Help and Support.
Create a new account
,
Search
, or Login:
Create reply in
Cloning and re-naming node in WebGL
Posted by:
(you are not logged in)
Enter the missing letter in: "Internati?nal"
(you are not logged in)
Text:
[quote][b][/b] wrote: ...so after two days I've finally figured it out: After cloning a node Windows build is changing node-references (like "this.MyNode") both in CC native scripts and in my custom scripts. WebGL build is changing ONLY native script references, not custom/user! So after I've changed all of the "this.MyNode" references with "node" or "currentnode" in my scripts things started to function :) Also my increment-var-number that I used for separating cloned names that worked in Windows build was this: [code]var nameadd_var = ccbGetCopperCubeVariable("nameadd"); var nameadd_value = nameadd_var + 1; var newname = "enemy" + nameadd_value; ccbSetCopperCubeVariable("nameadd", nameadd_value);[/code] ...but in order to work in WebGL I needed to code it like this: [code]var nameadd_var = ccbGetCopperCubeVariable("nameadd"); var nameadd_value = Number(nameadd_var + 1); var newname = "enemy" + nameadd_value; ccbSetCopperCubeVariable("nameadd", nameadd_value);[/code]Now number works in both Win & WebGL builds. So if anyone is targeting both Win & WebGL and has cloning of nodes with script-references like "this.MyNode"/"this.NodeName"/"this.Me": Use only "node" or "currentnode" references in your scripts.[/quote]
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