Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
How to find the current position of a object and change it? |
||||
|
If you have your object, which is usually a sub class of SceneNode (http://www.ambiera.com/copperlic...), then use its .Pos property. It's the position relative to its parent, but in most cases, this should be enough, since most objects are directly in the root, usually. To create a message box with the position, do for example this:
For changing for example the .x position, do this:
|
||||
|
Thanks for your reply. I am using Coppercube. When i use alert( yourNode.Pos );, It shows undefined. But when I use
It shows an output How can I get the x,y,z from it and add a value to each of it? |
||||
|
Ah, you posted this into the CopperLicht forum, so I assumed you are using the CopperLicht API. The calls you are using, all starting with ccb, are the CopperCube JavaScript calls. But you can use them as well. Changing a position there works similar:
|
|