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!
|