Page 1 of 1

parents and movement

PostPosted: Mon Mar 17, 2008 2:01 pm
by thunderios
When I was creating a soccer-game I made the ball the child of the player. There was an enemy chasing me, but when he came to the point I catched the ball, he stood still.
So I think when you parent something, the child does not change his x/y positions. It took me some time to find that out so I wanted to share that with the world :)

Maybe this should be changed in the feature, but it's no neccesary as long as you know what happens...

Re: parents and movement

PostPosted: Mon Mar 17, 2008 2:24 pm
by Caaz Games
the parenting makes it so when the parent moves the child moves with it and the child would have the same tranceparency and z depth

Re: parents and movement

PostPosted: Tue Mar 18, 2008 1:17 am
by DilloDude
The x and y coordinates are relative to the actor's parent. (If there's no parent, than it's relative to the game centre) So if you want to calculate distance/direction etc. try using xscreen and yscreen instead (as they are always relative to the same location for any actor).