Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
yep |
||||
|
https://www.ambiera.com/coppercu... |
||||
|
This ?? //------------------ var a = ccbGetSceneNodeFromName("scene_node"); if ( a ){ var a_pos = ccbGetSceneNodeProperty(a, "Position"); } var b = ccbGetSceneNodeFromName("another_scene_node"); if( b ){ var b_pos = ccbGetSceneNodeProperty(b, "Position"); } if( a && b ){ ccbAICommand(b, "moveto", new vector3d(a_pos.x,a_pos.y,a_pos.z)); } //------------------ |
||||
|
Thanks I'll check those out |
||||
|
Or you could simply set the position: var a_pos = ccbGetSceneNodeProperty(node1, "Position"); ccbSetSceneNodeProperty(node2, a_pos); There is also a command to set position and ignore collision: var s = ccbGetSceneNodeFromName("cubeMesh1"); ccbSetSceneNodePositionWithoutCollision(s, -22.097015, 9.848448, -40.738777); Also keep in mind, if node1 is parented to something, better use "PositionAbs" as Property name to get the real position. |
||||
|
Uh sorry, there's a bug in my above script, it should be: var a_pos = ccbGetSceneNodeProperty(node1, "Position"); ccbSetSceneNodeProperty(node2, "Position", a_pos); |
||||
|
|