Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Studio Chat / get child position

Author
Message
smerf
16
Years of Service
User Offline
Joined: 24th Feb 2005
Location: nm usa
Posted: 12th Jul 2020 18:20
I have an object with several children. I can manipulate them but cant get their location because their origin is offset. Any solution?

ando
1
Years of Service
User Offline
Joined: 21st Feb 2020
Location: Australia
Posted: 12th Jul 2020 19:58
float GetObjectWorldX( objID )
float GetObjectWorldY( objID )
float GetObjectWorldZ( objID )
Never play leap frog with a unicorn.
smerf
16
Years of Service
User Offline
Joined: 24th Feb 2005
Location: nm usa
Posted: 12th Jul 2020 21:20
I tried that ando, i can see the mesh bust i cant seem to put anything where it is due to the origin offset

ando
1
Years of Service
User Offline
Joined: 21st Feb 2020
Location: Australia
Posted: 12th Jul 2020 23:11 Edited at: 12th Jul 2020 23:31
Only guessing but maybe...



You might have to rotate the parent to 0,0,0 then position the object, set it as a child then rotate the parent to where it was.

Or what about just setting the object as a child of the child minus the world XYZ offsets in the snippet above ?

Or...
Never play leap frog with a unicorn.
blink0k
Moderator
8
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 12th Jul 2020 23:35
Do you want to position something and then fix it to the mesh using FixObjectToObject()?
ando
1
Years of Service
User Offline
Joined: 21st Feb 2020
Location: Australia
Posted: 13th Jul 2020 01:25 Edited at: 13th Jul 2020 01:44
this might work, it does for me.


EDIT- except for objects going invisible when I rotate the parent ! lol
Never play leap frog with a unicorn.

Login to post a reply

Server time is: 2021-12-04 07:52:42
Your offset time is: 2021-12-04 07:52:42