Topic: How to get the position of a clone?

Hi, everyone!
I have a question. Is it possible to get the position of a clone object?
Let's say I have simple script like this:

Sphere = getObject("Sphere")

function onSceneUpdate()

    bullet = getClone(Sphere)
    translate(bullet, {0, 1, 0}, "local")

end

Now, I can get the position of the Sphere using getPosition(Sphere). But how can I get the position of the bullet? I tried using the same getPosition function, but it doesn't seem to work. Anyone can help?

Re: How to get the position of a clone?

Sphere = getObject("Sphere")
bullet = getClone(Sphere)

function onSceneUpdate()

    pos = getPosition(bullet)
    print("x="..pos[1].." y="..pos[2].." z="..pos[3]) --checking.
    translate(bullet, {0, 1, 0}, "local")

end

Last edited by ant0n (2014-10-02 02:43:49)

Re: How to get the position of a clone?

Oh I see... So I can't get the position of the object if I clone it during runtime.
That's interesting. Okay, lesson learned! Thanks alot Ant0n! That really helps big_smile! Thank you!