Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Programming and Scripting
A matter of two seconds)

Hey
Guest
Quote
2021-03-24 21:28:49

var cubT = ccbGetSceneNodeFromName("trigerC");
var cam = ccbGetSceneNodeFromName("Player");
var camPos= ccbGetSceneNodeProperty(cam, "Position");
ccbSetSceneNodeProperty(cubT, "Position",camPos + 0,0,10);


How do I get the code to work correctly?
I want to move the cube relative to the camera to the point 0,0,10, but the coordinates add up somehow incorrectly
I will be glad of any help


Robo
Guest
Quote
2021-03-25 13:00:43

change the last line to:
ccbSetSceneNodeProperty(cubT, "Position", camPos.x, camPos.y, camPos.z+10);


Hey
Guest
Quote
2021-03-26 07:12:38

Thanks,Robo!


Create reply:


Posted by: (you are not logged in)


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