Unable to have a sprite stay over another sprite

I’m working on an abstract, top down grid-based game (think checkerboard). I’m not using GDev’s top-down movement; I’m moving stuff myself. I create a new ball sprite on a random grid square every few seconds, which then tweens up, down, left, or right from grid square to grid square by itself (and reverses when it hits a wall). I need to create another sprite, ghost, that simply always remains exactly over its ball. And I need each ghost instance to stay attached to the ball instance it was created with. Currently, when I create a ball object, then a ghost object at the same position, the ghost only follows the ball until another ball is created. Then it tweens to the new ball position instead of staying attached to the ball it was created with.

I can’t follow the documentation or examples I’ve seen. I’ve looked into the Physics engine Joint function, but I can’t understand it. I’ve also seen reference to parent and child objects (which seem to be variables), but I don’t understand it either…and I can’t find them in the Events editor. Wrapping an object around another doesn’t work.

Can anyone guide me to some clear documentation on creating multiple objects that each has a sprite “assigned” to always move with it?


I just found this posting from Gruk. It seems to be working for me, too! Thanks, Gruk!!