How can I connect upper and lower body animations?


I’m making a platformer and I have a problem with connecting upper and lower parts of the sprite. Basically, I tried making seperate entity (upper body)and have it spawn on top of sprite (legs) but it didn’t work out very well since body disconnects sometimes resulting in weird stuff.

Are there examples or tutorials for stuff like this?
Because I’m kinda lost and haven’t found much…

Make an event that keeps the position of the legs always at the same point (point that you define on the upper body) or vice-versa.
It will look like this:

1 Like

I’m not sure if I understood correctly:

This creates a character, but the upper torso doesn’t “glue” to the position of legs.
Instead it just stays behind.

I said always and you show me a trigger once :slight_smile:
Put it in a separate block, without conditions.

1 Like

Do exactly what GRUK says and create points to join the parts. Maybe creating variables can help you create always active conditions to join or separate parts.

here an example

1 Like

Excellent example, thanks!
Also, umm… I made action so when Right key is not pressed (Right key is pressed but inverted) then object Torso gets deleted.
Everything works fine, but when Right key is being released, the Torso dissapears and for a split second, there are only legs before switch to normal standing animation.
Any clue how to fix this? All sizes of sprites are the same

Do you want the torso to disappear or not? :thinking:

I do! …and it dissapears BUT for a little while, there are ONLY legs.
It’s shorter than second, but very noticeable.

You state the actual result, but you don’t state the expected result, so I can’t help you. :man_shrugging:

Sorry, I thought it was obvious.
I want the sprite to instantly switch into the other one, without this “delay”

When GD reaches the end of your events page, the game frame is displayed. If at this point, the torso has been deleted but nothing has replaced it, then it won’t show.
The order of events matters. This is explained in the basic documentation about GD.