playMaker

Author Topic: Ragdoll Workflow?  (Read 2486 times)

beowulfkaine

  • Playmaker Newbie
  • *
  • Posts: 47
Ragdoll Workflow?
« on: July 29, 2017, 04:24:10 AM »
Looking everywhere and I can't find it.  Simple question for some, essentially I  have a character that has a ragdoll prefab as well. I want to know what the step by step workflow is to go from his mechanism animation to a ragdoll state? Is it possible to get the force hitting the object to be applied to the ragdoll as well throwing it in the air? I appreciate your help!

Thanks in advance!

tcmeric

  • Beta Group
  • Hero Member
  • *
  • Posts: 768
Re: Ragdoll Workflow?
« Reply #1 on: July 29, 2017, 08:42:11 AM »
Did you try my suggested asset from your previous post? http://hutonggames.com/playmakerforum/index.php?topic=15392.msg71217#msg71217

beowulfkaine

  • Playmaker Newbie
  • *
  • Posts: 47
Re: Ragdoll Workflow?
« Reply #2 on: July 29, 2017, 12:10:05 PM »
Hello tcmeric! Yes, I did try to follow along with it, but for some reason, I could not get it to work as you were showing in the video.  I do have that asset and I love it for many of its cool features, however, my application is a bit different.  As you remember I'm in a VR situation in which I am using physical objects, in my particular case, the bow and arrow from the steamVRr interactable object scene.

It uses a physical arrow with a collider that fire off the bow when released.  It does not use a raycast, which is where I had the roadblock.  Your video, which was well appreciated as are all your informative videos you make, didn't cover anything that would work with physical impacts.

I wrote the author and he told me this:

About rocket feature its like this:
1- start ragdoll
2- pick a bodypart you with to move
3- apply velocity upwards to that bodypart

Heres little code: 
     
 m_Ragdoll.startRagdoll();
RagdollManager.BodyPartInfo bpInfo = m_Player.ragdoll.getBodyPartInfo(9);
bpInfo.extraForce = Vector3.up * 4;


However, I am not a coder, hence why I use playmaker.  I've tried to monkey with that bit of code to no avail and got frustrated after a week of trying.

My application seems almost too simple, I wish to use the hit reaction on enemies, the arrows attach to the body part (which I finally figured out yesterday with colliders and physics materials) and most importantly, the Rocket feature, I love that, it makes me laugh so much and I can create so many funny death scenes with it.

I didn't keep bothering you about this because you've probably really busy with stuff and I didn't want to be a burden. I like learning things and at 40'ish that's pretty easy to do, especially with my background.  I wish I had more time to study c#, but it's hard to grasp it and there are not many videos on it that are ELI5.

I have really gotten the fundamentals of playmaker, which honestly, is better than sliced bread for me. I'm still learning all the actions, Array is one I keep thinking would help me somehow but I have absolutely no idea how to use it and I've tried to wrap my head around it as to what I can use it for.

So in layman's terms:

Set FLOAT (local variable: Health = 100) I got the Int and floats down pretty good thanks to you.
Arrow on hit (body part enable hit reaction on body part with force) attach to body part
If body part attach (optional: play animation and particle effect)
Add INT: -50 (Or whatever number) negative number
Compare FLOAT to Variable
If FLOAT is <0 then Event (this one I got pretty good)

Rinse and Repeat as needed

With hit manager my intent when I bought it was to be able to use all those effects (rocket launch, bubble capture and rise,Mine exploder and then the harpoon) but all attached to an arrow which uses a physical Collider.

I've also been trying to figure out a way to explode the characters that isn't cpu intensive as many characters would explode at once at one point.  I tried Mesh Exploder, Exploder, Mesh Exploder FX and my favorite DestroyIT.  Only two work with skinned meshes as it turns out.  I'm making a lot of people happy buying assets I can tell you that.

What would be ideal is it I could previously fracture the skinned meshes and have them be replaced when death occurs use force to knock back the fragments on what was hit if a ragdoll is not being used like this:



Scott Pilgrim, the greatest movie ever made BTW.

But that's whole other can of worms.

tcmeric

  • Beta Group
  • Hero Member
  • *
  • Posts: 768
Re: Ragdoll Workflow?
« Reply #3 on: July 29, 2017, 07:34:30 PM »
No worries. I think we can figure a way to work it out. Let me take a look at my actions again. We might need something like adding a FSM with a collision event. Then using the event to determine the hit body part to apply the extra force.  8)

Personally I have the one called fracturing and destruction, but havent had a chance to deep dive it yet. Always hard to know what is going to work until you have it going.  :'(

tcmeric

  • Beta Group
  • Hero Member
  • *
  • Posts: 768
Re: Ragdoll Workflow?
« Reply #4 on: July 29, 2017, 08:02:15 PM »
After playing around with it, did you try adding a really short raycast to the front of the arrow? Basically the tip of the arrow can have tiny raycast, and then you can use the actions like the tutorial video as a starting point.

beowulfkaine

  • Playmaker Newbie
  • *
  • Posts: 47
Re: Ragdoll Workflow?
« Reply #5 on: July 29, 2017, 08:06:58 PM »
I'm afraid I have no idea how to even contemplate on how to accomplish that