New guy planning game, help with parenting / alternatives

Hi, I’m in the planning stages of making a side scrolling shoot em up game. I will need to have sprites that have multiple parts that I need parent / child setups for, and although solutions seem to exist, a lot of answers are for older versions or dead ends…plus I’m very new :smiley:

What I want is to have a base player sprite with collected weapons appear over it, along with larger enemy sprites with destructible parts (think the large battleship in R-Type).

I can think of a few workarounds that might mitigate this problem, but the simplest and sanest way I can think of so far is a straight parent.

This seemed the most promising, but the target thread is missing: How to make an object parent to another? - #5 by Mats and that its very old.

So, in GD5 what is the most robust parenting method? Is it a case of having a sprite with custom points generated and moved along with another sprites point? Either way can someone give me an idea of what to do? I apologise in advance if this has been asked before, and thank you for any answers!

Cheers, R

1 Like

The object parenting is something that i want to get into too for sure but i am not in this stage for now a lot of other things need to be done before parenting be my consern i hope to get the information you seak and good luck with your game i will have an eye to your post :slightly_smiling_face: be well brother

Example is included with GD called “Pin object to another”.
Most simple way to do it is to use points and simply set the position of parts to the points on the player.
The other solution is using math expressions or “Put object around an other” event. Example is included.

Thanks!

That pin example is almost exactly whats needed. My next test will be to see if objects can be destroyed / created on the fly and parented in this way.

In that example is it possible to change the ‘At scene start’ with some sort of event each tick of the engine / frame to update the rotation / position?