Make 'em drop? Ragdoll Boogie

I’m working on a demonstration project where I can propagate a character. The character walks from Point A to Point B. I have 14 different characters with different gait animations, different speeds, different skins. I have on master controller blueprint “BP_GenericAISpawner”. A simple key push spawns these AI characters ( key press 1 thru 0 and Shift 1 thru Shift 4. ) Everything works well.

Not sure the best way to proceed.

Desire:

  • I want to be able to ragdoll drop a character at a given location, either via a keypress or an invisible collision box.
  • I want the option to drop or not drop the character during run time.

Possible ways to proceed…

  1. Add RagdollCollapse function to each AI character, use keyboard, on demand. R for Ragdoll drop. Initial testing = fail, not sure why key events not propagating. I’m working on it, not sure if I really need this or not. Its not clear to me if I can use the same keystroke as an input in 14 different blueprints.
  2. Add a transparent box kill zone in the sector. All AI characters ragdoll immediately upon contact. Toggle the Z value of the kill zone box between present to minus 10 feet below the ground based on a keyboard input. (Isn’t this how the vehicle security bollards work in Washington DC?)
  3. I know I could create a small kill zone box, hide it behind an appropriately shaped blocking NavModifierVolume. For AI characters I want to drop, I could program their location to the kill zone box. The would go around the NavModifierVolume hit the box and drop. Others with distant target would avoid that path. This would probably work but it feels like such a hack. I’d have to add some control technique to determine which destination will be used, perhaps Control or ALT or other keys on entry?

Other ideas here? Feedback on how to proceed? many thanks

Not sure what was best, but here’s where I headed.

  • All of my Spawned AI Characters were based on a Parent Class of “Character”
  • I simply created a new Character class with the same origin called “ParentCharacter_BP”.
  • In that Parent class I added the function “RagdollCollapse”
  • That function utilizes nodes “Set Simulate Physics” and “Disable Movement”. (See attached)

  • I also adjusted the Mesh details within ParentCharacter_BP: Physics Linear/Angular Damping: 0.99 Collision Collision Presets: Ragdoll.
  • Then I went to each of the AI character blueprints, selected “Class Settings” and swapped parent class from “Character” over to “ParentCharacter_BP”.

Over in my master BP_GenericAISpawner blueprint, Upon a push of the R key (R for Ragdoll) I grabbed all the actors of the class ParentCharacter_BP, ran them thru a ForEach loop, cast each array element to ParentCharacter, then call the function RagdollCollapse.

This whole inheritance thing was pretty simple to implement. Wish I’d thought of it earlier. So basically the answer I chose was #1 for the win.