0
Answered

Does Ragdoll work with non humanoid characters

Bruv 4 months ago in Behavior updated by Marti (Lead Developer) 4 months ago 4

I'm building a melee combat scene and the enemy is a giant spider. I have some simple animations (walk, run, idle, rear-up, attack, and die). I've got everything to work OK except the death bit. I've set up the behaviour to check the health and when it reaches zero the death animation is triggered. Problem is, after the death animation the spider pops up again and then dies again and just repeats. The die.anim isn't looped. Can anyone point me in the right direction for a series of actions that will definitely kill my spider. (before you say it: I've tried a rolled up newspaper:)

Unity version:
2020.1
Game Creator version:
1.1.8
Answered

Unfortunately, there's no ragdoll for non-humanoid characters. A ragdoll is basically an automated process that places a bunch of colliders (sphere for head, capsules on arms and legs, etc..) with a joint constraint. But because non-humanoid can take any shape, we can't generate the colliders for you.

You can still work around this creating a custom configuration of colliders with joins that simulate the ragdoll and enable them when the spider dies. Although it's quite an endeavor.

Sorry, I'm new to the forum and I should have clicked reply to your answer. I didn't explain myself well in the OP. I clarified it below. Hope that's OK.

Actually I did realize there was no way the usual ragdoll method would work, I suppose what I should have asked is if there is an alternative way to get my spider model to cease functioning. As I said, I've got it to the point where I can use states for the usual movement and I can trigger the death animation with gestures. I've done this using  behaviours but I now need to discover a suitable Actions or Conditions or Trigger function(s) to stop the character after the death animation has played and just leave it dead. Can you please advise me on that? Or is Game Creator just not suitable for non-humanoid enemy characters?

+1

Hi Bruv, GC is definitely suited for both humanoid and non-humanoid characters. However, you still need to create the logic behind your characters.


There are multiple ways to tackle this. In the demo I'm preparing to showcase the Melee module, what I do is to create a Local Variable of type Bool on every enemy called "is-dead". By default is false, and when the enemy dies, I set the value to True.

Then, I can use this to control whether the character can respond to certain inputs or not. For example, if you're using a Behavior Graph, you can add a "Selector" node right after the root and and a left-most Task with the condition "Variable Bool" that checks if the "is-dead" variable is true. This will force the Behavior Graph to ignore the entire tree if the character is dead.

If you have Triggers, you can use a Condition that checks if the character is not dead before proceeding executing the Actions.