karim.salama Posted January 14, 2022 Posted January 14, 2022 Hello, Sorry for asking so many questions about UnigineScript lately. I know it's deprecated and not recommended but I'm porting old UnigineScript so there is no other work around for now. The following UnigineScript code was used in Unigine 2.6.1 which creates a new root node into the currently loaded world : Node g_not_saved = 0; string NOT_SAVED_NODE = "not_saved"; Node getNotSavedNode() { if(g_not_saved == 0) { g_not_saved = new NodeDummy(); g_not_saved.setName(NOT_SAVED_NODE); { // Setting this to 1 stops the node from being saved. int IS_RUNTIME_NODE = 1; engine.editor.addNode(node_remove(g_not_saved), IS_RUNTIME_NODE); } } return g_not_saved; } In an attempt to migrate this into 2.15, and according to this page, here is how the script was ported : Node g_not_saved = 0; string NOT_SAVED_NODE = "not_saved"; Node getNotSavedNode() { if(g_not_saved == 0) { g_not_saved = new NodeDummy(); g_not_saved.setName(NOT_SAVED_NODE); node_remove(g_not_saved); //Is this even necessary? } return g_not_saved; } Now the new NodeDummy seems to be added into the world but is not in its hierarchy as a root node. Any one knows why? Thanks in advance
silent Posted January 16, 2022 Posted January 16, 2022 More likely you need also to call setShowInEditorEnabled(1) in order to have this node enabled in hierarchy. How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
Recommended Posts