Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
How would I move a player camera object's position to new clones of an instantiated node? How would I write that in JS??? Perhaps something Like ccbAICommand "moveto" this.clone.position? I have a set of cloned scene nodes and I want to be able to move the player camera to the next closest node in a set of clones based on "WASD" input. Please Help Thanks in Advance |
||||
|
NM, I think I figured something out that will work. Just working still on my big planets for my game. Too many distractions where I am living. LOL |
||||
|
The best way is this... To be able to access the clones of the node, create a base node then add 1 to the name (e.g "fire1") then to get the clones of the same node, just use a loop and then keep adding to the number to the base name i.e "fire" + 45 Something like this...
|
||||
|
When some uses the "Instantiate" Javascript command, is that the same as using ccbclonescenenode or is it something different? I have a group of nodes that were created with the instantiate command, but I don't know how to get the camera to move towards the next node based on player WASD input. I'm guessing I'll need to use an array, but I wouldn't know how to put one together by myself. |
||||
|
I have never used the instantiate command... So I advice you to use the clone command instead... And to create an array, in the loop... Let it append each object to an earlier created array... e.g
|
||||
|
Then you can use the array to calculate the next node for the camera to move to. (I actually think it would be base on distance |
||||
|
As I mentioned I have never put together or could in the past put together an array. Sorry bro, I'm just more of a complete non-coder:( :) |
|