How to make a 2d Active Ragdoll?

So, I’m trying to make a character similar to that of Gang Beast, Human Fall Flat, etc. However, I’m unsure of what kind of joint to use for the body pieces, as well as the configuration. Basically, I have NO clue how to do this. Any help whatsoever would be greatly appreciated.

Thanks,
Inusitatus

This is a pretty good example. There is even a gore mode with particles haha.

1 Like

This example was useful, i just couldnt seem to get my part to line up, and I wasnt sure if there was a way to manipulate the body parts in a way to simulate a actual playable character. Im currently trying to utilize motor joints to see if they work, we’ll see.

This is what i got so far


This is the basic offset configuration

And i set the pieces like this

And i get this result
image
Also, it rolls a little, then bounces to infinity and beyond(ok, thats a bit dramatic, but whatever)

I’m getting desperate. :pensive:
(And a headache)

Yes you’ve taken on quite the challenge :joy: frankly I think the amount of work it would take to make a ragdoll + moveable player character with multiple objects connected with joints would be extremely difficult. Perhaps someone like MrMen or SilverStreak will come along with some awesome and out-of-the-box advice, but my suggestion would be this. While the player is being moved (lets say with WASD) it can be one single sprite (with multiple movement animations of course), when the times comes and you want it to ragdoll (perhaps with mouse dragging, falling off cliff, banging into wall, etc.) you can then replace that single sprite with the ragdoll joint setup. I know it’s a bit of a cop out, but with the right animation setup I think you could get it to work as long as the transition is smooth enough.

Edit: I suppose another method would be to connect the ragdoll appendages (arms + legs) to 4 other dynamic physics objects. When the movement controls are pressed these 4 objects will also move, thus “dragging” the rest of the body with them.

1 Like

yeah, it would be WAY easier if there was an action to apply a physics force to get to a specified angle, as opposed to just spinning it. imma submit a request for that.

True, with the ladder example you would also need even more joints just to simulate the bending of arms/legs. I’d recommend trying the sprite+joint setup and seeing how it goes. With some tinkering I believe you could make it work, and it would probably be far easier than just using joints and physics movement to “walk” the player.

That could work, however that would change how the game would work. I am fully prepared to get the physics animation stuff to work, the real problem is getting the ragdoll to be put together, and in a way that i can manipulate i later.

Hmm okay well now I’m a bit invested so I’m going to see if I can put together a ragdoll that can be manipulated with those 4 extra physics joints/objects (not sure which one it should be yet) that will move the player such that it can be “walked” as well as ragdolled without using any cheap sprite replacements or what not. I’ll keep you updated if I make any progress.

1 Like


These events combined with this layout (along with some physics layers changes)

Gives this result: (arms attempt to follow cursor, for things like climbing or carrying)
image

Keep in mind you can combine joints, so consider adding a rope joint with length 0 on top of the motor joint. This should help to keep the different sections connected.

And you can add multiples of the same joint type to make the connection stronger - so 2 or 3 rope joints if an unacceptable gap still appears.

Wow, thank for that info, i had no idea, imma try that with his legs and arms, they are a little too floppy for my liking.

now im having a little trouble with swinging the legs when he walks, any pointers?
Also, i cant seem to be able to get joint ids to work, any ideas?

Can you describe the issue in a bit more detail?

What do you mean by that?

i want the legs to first swing one way, then the other in a walking fashion constantly while he is walking, and i am unsure of how to achieve that.
Second, i assign the joint to a variable, then when i try to delete the joint, i call the variable when i use the delete joint action

That’s not ragdoll any longer, and I suspect it’s a bit more involved than anticipated. I would suggest you google the topic and see how other game devs achieve this. The game engines they use won’t be GDevelop, but you’ll get the idea of how it’s done, and can apply the same principles to your GDevelop project.


And the variable is unique for each joint you add?

Yes, i have looked up tutorials on how to make a 3d “Active ragdoll” in unity, its a bit complicated, and here is an example of the kind of thing im trying to achieve (SpiderDoll 🕹️ Play on CrazyGames).

I forgot to assign one for one of the hands(to grab), but even then it doesnt work.


The right hand joint’s variable is RARM, and left is LARM.

I also cant find a good way to make him attempt to stand up

If you’re not after a very realistic movement style, you could make the body a kinematic object, and move that round, while jiggling the legs in a faux walking type fashion. You may end up with something vaguely like the Thunderbirds marionettes.