How to make a 2d Active Ragdoll?

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
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)

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.

i got something useable(kinda)

i made a motor joint between the torso and an invisible helper object that has fixed rotation. If he is grounded, activate the angular offset torque, and apply torque to his righ leg on way, the left the other, and if it exceeds a certain angle, reverse it, meanwhile add a force to the torso in the desired direction. the self balancing isnt perfect, but it suits my goals.
to play the included game, just left click and right click to fire webs, double tap either to shoot
edit: still needs work, imma add walking up walls :grinning:

Here is the updated version, with walking, climbing, and better assets!

1 Like

Also, submit your art at Calling All Creative Minds: Design Your Own Character Skins for My Game