Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Programming and Scripting
ccbGetCurrentNode();

gar
Registered User
Quote
2016-10-31 21:49:06

Hi !
How do we use this function ?

On proximity do something --> print(ccbGetCurrentNode()); gives me nothing


niko
Moderator
Quote
2016-11-01 05:24:06

Try something like this:

var n = ccbGetCurrentNode();
var name = ccbGetSceneNodeProperty(n, 'Name');
print("name: " + name);



gar
Registered User
Quote
2016-11-01 10:50:29

Thank you. I will try that


potticus
Registered User
Quote
2016-12-29 11:30:06

I couldn't get that example code to work with print, so used alert instead. Also, I had to clear the variables each time before use in order to make it work more than once:


var n = "";
var name = "";

n = ccbGetCurrentNode();
name = ccbGetSceneNodeProperty(n, 'Name');
alert("name: " + name);


Just in case anyone wants an example that works out of the box.

However, I can only seem to get this to work locally. When I upload to my server it doesn't work, any ideas? Thanks


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