When I updated puppetmaster and final IK I got a new issue. Now when I spawn in a creature into my game the puppetmaster part of the rig gets pushed way off the level. I'm not sure why this is happening. If I disable the puppetmaster component then reactivate it after the gameobject is created the puppetmaster won't fly off but will give me a warning that the bone's aren't close enough together which I might be able to do a workaround by freezing the position until the puppetmaster is enabled. Though it seems like I shouldn't need to do this at all. Have any ideas?

When I updated puppetmaster and final IK I got a new issue. Now when I spawn in a creature into my game the puppetmaster part of the rig gets pushed way off the level. I'm not sure why this is happening. If I disable the puppetmaster component then reactivate it after the gameobject is created the puppetmaster won't fly off but will give me a warning that the bone's aren't close enough together which I might be able to do a workaround by freezing the position until the puppetmaster is enabled. Though it seems like I shouldn't need to do this at all. Have any ideas?

Click to expand...

Hey,
Could you send me that PuppetMaster rig in a repro project or something so I could take a closer look?

As I understand, this tool is not meant for rag-dolls using 2D components (rigidbody2D, 2Dcolliders etc.), right? How hard would it be to adapt it for 2D?

Anima2D is quite nice (and free) where you can create a skeleton based 2D animation with sprite-mesh and IK and stuff. I would really like my 2D animation to be affected by 2D physics just like your PuppetMaster is affecting 3D animations. Any ideas?

So I really want to buy this asset, it looks great and might be exactly what I'm looking for.

HOWEVER! the tutorials are very basic in nature and the documentation is very limited. I get that the asset isn't finished yet but how am I to understand this asset and use it if I can't delve deep into it? Am I missing something, is there documentation included when I buy the asset that gives me a detailed overview of the functions?

Hiya! I've encountered this bug several times now
several times now and I'm wondering if someone has solved how to fix this? I'll explain what this is first, This Model was rigged using Mixamo's Auto Rigger, this arm shaking occur when Angular limits is turned on and the humanoid animations look weird as well. I just can't figure out what the problem is. Yep that's it!

As I understand, this tool is not meant for rag-dolls using 2D components (rigidbody2D, 2Dcolliders etc.), right? How hard would it be to adapt it for 2D?

Anima2D is quite nice (and free) where you can create a skeleton based 2D animation with sprite-mesh and IK and stuff. I would really like my 2D animation to be affected by 2D physics just like your PuppetMaster is affecting 3D animations. Any ideas?

Click to expand...

Hey,
It can't be used with 2D physics components, but if you rig your sprite character with 3D physics components and make it a 2.5D character, it can be done. There is a demo included for that, in Plugis/RootMotion/PuppetMaster/_Integration/Goblin Archer (2.5D Puppets).

So I really want to buy this asset, it looks great and might be exactly what I'm looking for.

HOWEVER! the tutorials are very basic in nature and the documentation is very limited. I get that the asset isn't finished yet but how am I to understand this asset and use it if I can't delve deep into it? Am I missing something, is there documentation included when I buy the asset that gives me a detailed overview of the functions?

Click to expand...

Hey,
You are quite right, it is still in beta technically. Dont know if you have found them already, but in addition to the tutorials there is the User Manual and Script Reference. Also demos for almost everything and all variables tooltipped.

Hiya! I've encountered this bug several times now
View attachment 235242
several times now and I'm wondering if someone has solved how to fix this? I'll explain what this is first, This Model was rigged using Mixamo's Auto Rigger, this arm shaking occur when Angular limits is turned on and the humanoid animations look weird as well. I just can't figure out what the problem is. Yep that's it!

Click to expand...

Hey,
Perhaps the joint limits just dont' allow for the range of motion that puppet is trying to follow? What does the animation look like? Try loosening the limits..

First of all I want to thank you for your comprehensive work, I got both Puppetmaster & Final IK.
I am quite new to Unity & Game Development in General. Actually i am trying to build a Zombie-Shooter kind of game, but there is one issue with Puppetmaster, i do not really understand, and I would love to fix it.

I have this ugly Zombie-Girl, she is ugly, but one thing makes her even uglier, that is, in some moments during Behavior-Puppet, her Bones become very much dislocated. In this case the knee is somehow twisted, and I have included the Ragdoll view into the example Image. I do not know, what causes this Problem, have you also encountered this "behavior", and know what I could do to solve it ?

I attach a "beautiful" Image of my zombie-Lady, please don't judge her by her apperance. She can be quite nice, and she always longs to be very close....

Attached Files:

Hey,
It can't be used with 2D physics components, but if you rig your sprite character with 3D physics components and make it a 2.5D character, it can be done. There is a demo included for that, in Plugis/RootMotion/PuppetMaster/_Integration/Goblin Archer (2.5D Puppets).

Hey,
You are quite right, it is still in beta technically. Dont know if you have found them already, but in addition to the tutorials there is the User Manual and Script Reference. Also demos for almost everything and all variables tooltipped.

Hey,
Perhaps the joint limits just dont' allow for the range of motion that puppet is trying to follow? What does the animation look like? Try loosening the limits..

I'll just bring this back again because Unity's NavMeshAgent does not seem to work with the User Control AI, I tried editing that script so it would get NavMeshAgent component and Path but didn't work out so well. Help?

Hey,
Thanks for the info, looks like you found a bug. Please import this patch. It will prevent trigger colliders from being added to PuppetMaster management at all.
Pärtel

Click to expand...

Partel,

Back in march, you provided a patch to prevent Prop colliders from being effected by PuppetMaster at all. You added a bool called disableColliders to BehaviorPuppet that's used in BehaviourPuppetStateSwitching.cs in the SetColliders method to prevent those Prop colliders from being disabled. However the Prop colliders are still being effected (enabled) if they are attached to the Ragdoll when SetColliders is called because line 176 is enabling all muscle colliders. c.enabled = true and the props are muscles while they are attached to the Ragdoll.

To prevent PuppetMaster from messing with Prop colliders, I changed the code to the following in lines 176 and 177 in BehaviourPuppetStateSwitching.cs:

Code (CSharp):

if(!props.disableColliders&& m.props.group!= Muscle.Group.Prop)

c.enabled=true;

Would you consider providing a patch with something like this code so I have the ability to prevent PuppetMaster from messing with prop colliders at all. Perhaps you might change that bool from disableColliders to something like TurnOnOffPropColliders. So if it is false Prop colliders will never be effected by PuppetMaster. You might also consider moving the the TurnOnOffPropColliders bool closer to the DropProps bool in the inspector since both of those concepts deal with Props.

I've noticed that in a networked game, the puppet is split from the character's hierachy when spawned. This is causing issues with things like Raycasting for damage etc, any ideas on how to get around this?

Playing with the stagger behaviour, i'm having a little issue. When the character dies, the arms seems to keep doing the windmill even if i disable all behaviours. Any clue? I've tried calling the finish function too, but it has no effect.

Just a quick question. I remember a while back you mentioned you were working on procedural animations for balancing. Are you still working on this? And if so, do you have an estimate on when we might be able to get our hands on it? It would really be an outstanding feature!

First of all I want to thank you for your comprehensive work, I got both Puppetmaster & Final IK.
I am quite new to Unity & Game Development in General. Actually i am trying to build a Zombie-Shooter kind of game, but there is one issue with Puppetmaster, i do not really understand, and I would love to fix it.

I have this ugly Zombie-Girl, she is ugly, but one thing makes her even uglier, that is, in some moments during Behavior-Puppet, her Bones become very much dislocated. In this case the knee is somehow twisted, and I have included the Ragdoll view into the example Image. I do not know, what causes this Problem, have you also encountered this "behavior", and know what I could do to solve it ?

I attach a "beautiful" Image of my zombie-Lady, please don't judge her by her apperance. She can be quite nice, and she always longs to be very close....

Click to expand...

Hey, sorry for the delay!

At which point does it happen, when the puppet is unbalanced? What happens if you enable/disable "Angular Limits" and "Internal Collisions" in PuppetMaster? I'm thinking perhaps either one is blocking the puppet from reaching the target animation.

I'll just bring this back again because Unity's NavMeshAgent does not seem to work with the User Control AI, I tried editing that script so it would get NavMeshAgent component and Path but didn't work out so well. Help?

Click to expand...

Hey,
Could you share this script or even better that project, if possible, so I could test it out?

I've noticed that in a networked game, the puppet is split from the character's hierachy when spawned. This is causing issues with things like Raycasting for damage etc, any ideas on how to get around this?

Playing with the stagger behaviour, i'm having a little issue. When the character dies, the arms seems to keep doing the windmill even if i disable all behaviours. Any clue? I've tried calling the finish function too, but it has no effect.

Thanks a lot!

Click to expand...

Hey,
Go to the "Windmill Weight", drag the last key a bit to the left, does that help?

Just a quick question. I remember a while back you mentioned you were working on procedural animations for balancing. Are you still working on this? And if so, do you have an estimate on when we might be able to get our hands on it? It would really be an outstanding feature!

Thanks,
Matt

Click to expand...

Hey,
Yes, I have a precedural stagger behaviour, that also tries to keep the puppet balanced before switching to stagger), but it requires Final IK, its in the FIK integration package. This is how it looks like.

Edit: It's fixed partially. After patch, when I lock camera in position it works smooth (because of Smooth Physics in Character Controller now is on). When camera follows the target, then a camera sync problem comes up.

Hello,
First off, thanks for making such a great tool and for excellent support system, it really is fantastic work!

I am having some trouble understanding how to use MuscleCollision struct. I'd like to extract collision info from one of the muscles in the setup, let's say hips, so muscles[0] in most cases. But I am having trouble getting the struct to work. Could you give a short practical example as to how I could access collision info from one of the muscles?

Many thanks in advance and keep up the fantastic work you've been doing!

Edit: It's fixed partially. After patch, when I lock camera in position it works smooth (because of Smooth Physics in Character Controller now is on). When camera follows the target, then a camera sync problem comes up.

Click to expand...

Hey, sorry for the delay, I've been in Amsterdam for Unite Europe.
Weird, it's smooth both ways in my project. Anyway, I have to be in Geneva for the next week for some IK R&D, but after that I'll have another try at all that camera stuff.

Hello,
First off, thanks for making such a great tool and for excellent support system, it really is fantastic work!

I am having some trouble understanding how to use MuscleCollision struct. I'd like to extract collision info from one of the muscles in the setup, let's say hips, so muscles[0] in most cases. But I am having trouble getting the struct to work. Could you give a short practical example as to how I could access collision info from one of the muscles?

Many thanks in advance and keep up the fantastic work you've been doing!

Click to expand...

Hey,

Code (CSharp):

public BehaviourPuppet puppet;

void Start (){

puppet.OnCollisionImpulse+= OnMuscleCollision;

}

void OnMuscleCollision(MuscleCollision c, float impulse){

if(c.muscleIndex!=0)return;

Debug.Log(c.collision.relativeVelocity);// The Collision stored in MuscleCollision

}

But you could always also just put your code in OnCollisionEnter/Stay and add it to the hip gameobject.

2 Question:
1. I've noticed that the props my character is holding do not appear to be effected at all by the Internal Collisions setting on Puppet Master. My props are on a different layer than the ragdoll muscles and they are setup Not to collide with each other so perhaps that's why. I've been experimenting with damage effects (ie. showing damaged limbs etc) and I've found that I need to turn Internal Collisions on and increase my Muscle Damper value on the Puppet Master when I lower the Pin Weight and Muscle Weight on specific muscles (Right Arm and Sword Prop). When Internal Collisions is selected (On) it works on the Ragdoll muscles but does not appear to have any effect on the sword Prop he is holding. So the sword prop will still go right through the ragdoll colliders. Is this due to my layer setup between props and ragdoll colliders? If it is, is there anything I can do about making Internal Collisions work between my props and the rest of the ragdoll muscles just while I'm adjusting Pin Weights and Muscle Weights.

2. I've also noticed that when BehaviorPuppet is in Unmapped mode, adjusting Pin Weights and Muscle Weights on specific muscles on the Puppet Master has no effect. So before I adjust weights, I change the BehaviorPuppet mode to Active and then when I'm done messing with weights, I switch back over to Unmapped mode. Is the correct thing to do? I'm just wondering if it would be better for the system to detect a change in weights and automatically switch to active mode and then back to Unmapped if that was your original setting.

At which point does it happen, when the puppet is unbalanced? What happens if you enable/disable "Angular Limits" and "Internal Collisions" in PuppetMaster? I'm thinking perhaps either one is blocking the puppet from reaching the target Animation.

Pärtel

Click to expand...

Hi. I kind of figured it out, that the heavy distortion was result partly of improper relocation of the Colliders and to loosely configured Joints. (My Zombie wanted to be a super flexy-Zombie)
I just redid the ragdoll creation, took a more conservative approach, like simply Ragdoll creator, and done, and there was much less of a distortion.

The time the distortion happens, is when the Puppet Begins to transist between Fall and GetUp, if i remember correctly. It is now barely visible, but my eye is attuned to it now, so i can still notice. I do not remember anymore, if it was the exact result with "internal collisions" and "Angular Limits".

I will explore this issue later, when i have some time in my Project to adress those aesthetic issues. For now we can consider it Fixed.. Kind of.

I would really like it if there was a way to define Custom muscle groups. For instance when my character is hit on the left side, I fire off a left hit animation. When my character is hit on the right side, I fire off a right side hit animation.

Right now the muscle groups are defined more as appendage groups as opposed to side or area of body.

For example, being able to define a custom muscle group that includes LeftUpLeg, LeftLeg, LeftFoot, LeftArm, LeftForeArm instead of using a lengthy If then such as if (muscleIndex == 1 || muscleIndex == 2 || muscleIndex == 3 || muscleIndex == 8 || muscleIndex == 9) //If Left Side Hit

Hey,
Hey,
It could be worth it to increase Solver Iteration Count, that makes the joints more stable. And/Or enable Projection on the joints, that just makes sure they don't separate.
But if you need to simulate water, you might want to do it by using forces instead of constraints. Basically just add an upward force to each Rigidbody and add some sort of sine function to modify that force based on rigidbody position to simulate waves or currents.
Cheers,
Pärtel

Click to expand...

Hi, I meet similar issue, my character joints went to the wrong position when something fast hit my character. (that red cube was giving character an uppercut in this image)

Enabling projection works good for me, but line #411 in Muscle.cs says "Other projection mode will cause sliding" and I comment out this line in order to make it work. Is that a good practice? Any better idea about how to avoid this?

2 Question:
1. I've noticed that the props my character is holding do not appear to be effected at all by the Internal Collisions setting on Puppet Master. My props are on a different layer than the ragdoll muscles and they are setup Not to collide with each other so perhaps that's why. I've been experimenting with damage effects (ie. showing damaged limbs etc) and I've found that I need to turn Internal Collisions on and increase my Muscle Damper value on the Puppet Master when I lower the Pin Weight and Muscle Weight on specific muscles (Right Arm and Sword Prop). When Internal Collisions is selected (On) it works on the Ragdoll muscles but does not appear to have any effect on the sword Prop he is holding. So the sword prop will still go right through the ragdoll colliders. Is this due to my layer setup between props and ragdoll colliders? If it is, is there anything I can do about making Internal Collisions work between my props and the rest of the ragdoll muscles just while I'm adjusting Pin Weights and Muscle Weights.

2. I've also noticed that when BehaviorPuppet is in Unmapped mode, adjusting Pin Weights and Muscle Weights on specific muscles on the Puppet Master has no effect. So before I adjust weights, I change the BehaviorPuppet mode to Active and then when I'm done messing with weights, I switch back over to Unmapped mode. Is the correct thing to do? I'm just wondering if it would be better for the system to detect a change in weights and automatically switch to active mode and then back to Unmapped if that was your original setting.

Thanks
Allan

Click to expand...

1. I tried to reproduce this, went into the Prop scene, played it, scaled up the box collider on the "Prop M4", changed it's layer and toggled "Internal Collisions" off/on, everything seemed to work as expected. Maybe it's that the internal collisions have no effect on objects that are connected with joints, I mean for instance upper leg and lower leg will never collide even if internal collisions are on.

2. Maybe you are just seeing no effect because the puppet is unmapped. You'll only see it on the puppet after the ragdoll collides with something and mapping is blended in.

hello,
1.i'm having a problem to create a stable ragdoll on Genesis 8 starter model
it look like all the joint angle limits are for one side and some joint don't have them at allImage1 Image2

2.how can i create my own behaviors?

Click to expand...

Hey,
1. You are looking at in in ortographic mode so that's why you are probably not seeing the limits on ather axes.
2. Take a look at BehaviourTemplate, you can use it to get started with custom behaviours.

I would really like it if there was a way to define Custom muscle groups. For instance when my character is hit on the left side, I fire off a left hit animation. When my character is hit on the right side, I fire off a right side hit animation.

Right now the muscle groups are defined more as appendage groups as opposed to side or area of body.

For example, being able to define a custom muscle group that includes LeftUpLeg, LeftLeg, LeftFoot, LeftArm, LeftForeArm instead of using a lengthy If then such as if (muscleIndex == 1 || muscleIndex == 2 || muscleIndex == 3 || muscleIndex == 8 || muscleIndex == 9) //If Left Side Hit

would be very helpful for a cleaner codebase.

Thanks
Allan

Click to expand...

Hey, thanks for the feedback!
I have no idea how to actually do this without changing the Muscle.Group enum directly in the script. Making a group for almost every muscle would also make it more tedious to create group overrides and stuff. Perhaps tagging the muscles would make it easier?

Hi, I meet similar issue, my character joints went to the wrong position when something fast hit my character. (that red cube was giving character an uppercut in this image)

Enabling projection works good for me, but line #411 in Muscle.cs says "Other projection mode will cause sliding" and I comment out this line in order to make it work. Is that a good practice? Any better idea about how to avoid this?

Appreciate your support!

Cheers,
Zhu Chun

Click to expand...

Hey, that sliding thing I noticed when a ragdoll was standing on the ground and projection enabled, it began sliding slightly on its feet. If you are not noticing any problems with friction like that, feel free to use projection. If you override projection mode after PuppetMaster initiates, then you don't need to comment out that line.

PuppetMaster is working great at having them fall over things, get up, etc..

But I want to have weapons jolt the NPC when the impact happens. I tried AddForce() to the RigidBody on impact but nothing happens, also tried reducing the "Mapping Weight", "Pin Weight", "Muscle Strength" and "Muscle Damper" on arms, etc. but it just has the effort of causing them to follow the animation more loosely.

I also tried setting the puppet to unpinned on impact, but really it just hits the floor trying to following the animation.

I've already emailed you about this, but I figured I'd ask on here, maybe it'll be useful for someone else as well...

I have a unique situation where I need to switch the animators update mode from AnimatePhysics to Normal. Upon doing this the ragdoll flys into the air the majority of the time, or at least glitches out for a frame or two. I need a way to gracefully switch back and forth between the two seamlessly if possible.

I am making a physics based game and when the player does a certain thing, the Puppet Master jitters. If I change the Animator Update mode to Normal, the jitter goes away completely. When not doing this particular thing, it's smooth if set to AnimatePhysics, and jittery when set to Normal. So I have to go between the two.

I've already tried adapting your FixedLateUpdate script but that didn't help at all.

My current solution is not perfect, I disable the puppetmaster using puppetMaster.DisableImmediately();

Then in the next frame change the anim.updateMode = AnimatorUpdateMode.Normal;

Then reactivate the ragdoll in the frame after.

Sometimes, he glitches for a frame then goes back to being normal. Sometimes he flys into the air, but all of this is much more rare doing it this way.

PuppetMaster is working great at having them fall over things, get up, etc..

But I want to have weapons jolt the NPC when the impact happens. I tried AddForce() to the RigidBody on impact but nothing happens, also tried reducing the "Mapping Weight", "Pin Weight", "Muscle Strength" and "Muscle Damper" on arms, etc. but it just has the effort of causing them to follow the animation more loosely.

I also tried setting the puppet to unpinned on impact, but really it just hits the floor trying to following the animation.

What's the best way to implement this?

Click to expand...

killerjim,

First make sure you have the Ground Layers and Collision Layers options set correctly in Behavior Puppet in the inspector. I use physics layers to separate my enemies from the player. So I have to make sure Behavior Puppet on my Player has the EnemyRagdoll layer as one of the Collision Layers and visa versa. This ensures that the player ragdoll will collide with the enemy ragdoll. I also have my player ragdoll collide with various environment objects like rocks etc. Make sure you have the physics layers of those objects selected in the Collision Layers drop down menu in Behavior Puppet.

Then I use the Event that's built into BehaviorPuppet for ragdoll/"Muscle" collisions.

As long as you have a reference to behaviorpuppet just use
behaviorPuppet.OnCollisionImpulse += OnCollisionImpulse; in your Start method.

Then you need to have a method to receive the collision events:

Code (CSharp):

void OnCollisionImpulse(MuscleCollision m, float impulse)

{

if(m.collision.contacts.Length==0)return;

int layer = m.collision.gameObject.layer;

Debug.Log(m.collision.gameObject.name+" "+"Just Hit Me!");

}

You can think of this method as similar to OnCollisionEnter except it is fired whenever anything collides with any one of the ragdoll colliders.

Make sure you unsubscribe from the event when your puppet is disabled:

Code (CSharp):

void OnDisable()

{

UnsubscribeEvent();

}

void OnDestroy()

{

UnsubscribeEvent();

}

void UnsubscribeEvent()

{

behaviorPuppet.OnCollisionImpulse-= OnCollisionImpulse;//Collsions from other puppet

}

I agree ragdoll collisions could use it's own separate documentation and tutorial video. There is a ton of stuff you can do but it's all hidden away in the code, scattered across this forum, and sprinkled throughout the docs online. Hell I just recently learned that if you keep your Behavior Puppet in Unmapped mode for performance reasons, adjusting Pin Weight and Muscle Weight on individual muscles has no effect. You have to switch the Behavior Puppet to Active mode, make your adjustments and then switch back to Unmapped.

PuppetMaster is working great at having them fall over things, get up, etc..

But I want to have weapons jolt the NPC when the impact happens. I tried AddForce() to the RigidBody on impact but nothing happens, also tried reducing the "Mapping Weight", "Pin Weight", "Muscle Strength" and "Muscle Damper" on arms, etc. but it just has the effort of causing them to follow the animation more loosely.

I also tried setting the puppet to unpinned on impact, but really it just hits the floor trying to following the animation.

What's the best way to implement this?

Click to expand...

Hey,
In addition to the helpful comments by Chaneya,
you are probably not seeing enough jolt just because you are not dealing enough of an impact to jolt the NPC. With PuppetMaster the puppets are normally using pinning forces to keep pinned to the animation, which unfortunately, but inevitably also dampers any incoming collisions. That is not what happens in real life, obviously there are no forces keeping us where we are other than the ones coming from our own muscles. That's why if a puppet intends to hit another puppet, you'll need to use additional force/damage. That is precisely why the Boosters have been implemented. In your character controller script, define a public Booster booster;, fill it in in the Editor, setting impulseMlp to a high value (loosens the other puppet mode) for the weapon muscle and immunity to 1 (infinite collision resistance) if necessary. Then, right before the weapon is supposed to hit in the animation, call booster.Boost(behaviourPuppet);
The effect of the booster will be faded out by the "Boost Falloff" of BehaviourPuppet over time.

I've already emailed you about this, but I figured I'd ask on here, maybe it'll be useful for someone else as well...

I have a unique situation where I need to switch the animators update mode from AnimatePhysics to Normal. Upon doing this the ragdoll flys into the air the majority of the time, or at least glitches out for a frame or two. I need a way to gracefully switch back and forth between the two seamlessly if possible.

I am making a physics based game and when the player does a certain thing, the Puppet Master jitters. If I change the Animator Update mode to Normal, the jitter goes away completely. When not doing this particular thing, it's smooth if set to AnimatePhysics, and jittery when set to Normal. So I have to go between the two.

I've already tried adapting your FixedLateUpdate script but that didn't help at all.

My current solution is not perfect, I disable the puppetmaster using puppetMaster.DisableImmediately();

Then in the next frame change the anim.updateMode = AnimatorUpdateMode.Normal;

Then reactivate the ragdoll in the frame after.

Sometimes, he glitches for a frame then goes back to being normal. Sometimes he flys into the air, but all of this is much more rare doing it this way.

Is there a more graceful way to do this?

Click to expand...

Hey, could you tell me in a bit more detail, what is the situation and the state of the puppet at the time you need to switch update mode. Also, at what time percisely in the frame are you calling for that change? I mean from Update, LateUpdate or something else?

First make sure you have the Ground Layers and Collision Layers options set correctly in Behavior Puppet in the inspector. I use physics layers to separate my enemies from the player. So I have to make sure Behavior Puppet on my Player has the EnemyRagdoll layer as one of the Collision Layers and visa versa. This ensures that the player ragdoll will collide with the enemy ragdoll. I also have my player ragdoll collide with various environment objects like rocks etc. Make sure you have the physics layers of those objects selected in the Collision Layers drop down menu in Behavior Puppet.

Then I use the Event that's built into BehaviorPuppet for ragdoll/"Muscle" collisions.

As long as you have a reference to behaviorpuppet just use
behaviorPuppet.OnCollisionImpulse += OnCollisionImpulse; in your Start method.

Then you need to have a method to receive the collision events:

Code (CSharp):

void OnCollisionImpulse(MuscleCollision m, float impulse)

{

if(m.collision.contacts.Length==0)return;

int layer = m.collision.gameObject.layer;

Debug.Log(m.collision.gameObject.name+" "+"Just Hit Me!");

}

You can think of this method as similar to OnCollisionEnter except it is fired whenever anything collides with any one of the ragdoll colliders.

Make sure you unsubscribe from the event when your puppet is disabled:

Code (CSharp):

void OnDisable()

{

UnsubscribeEvent();

}

void OnDestroy()

{

UnsubscribeEvent();

}

void UnsubscribeEvent()

{

behaviorPuppet.OnCollisionImpulse-= OnCollisionImpulse;//Collsions from other puppet

}

I agree ragdoll collisions could use it's own separate documentation and tutorial video. There is a ton of stuff you can do but it's all hidden away in the code, scattered across this forum, and sprinkled throughout the docs online. Hell I just recently learned that if you keep your Behavior Puppet in Unmapped mode for performance reasons, adjusting Pin Weight and Muscle Weight on individual muscles has no effect. You have to switch the Behavior Puppet to Active mode, make your adjustments and then switch back to Unmapped.

Allan

Click to expand...

Hey, thanks for helping out a fellow user..
About the last paragraph, what kind of doc/tutorial exactly would you need? About 2 characters fighting each other?
Adjusting pin weight and muscle weight on individual muscles does have an effect in Unmapped mode, you are just not seeing it, as the character is not mapped to the ragdoll. Select the PuppetMaster gameobject and see the behaviour of the ragdoll change in the Scene view as you adjust those weights in Unmapped mode.

Hey,
In addition to the helpful comments by Chaneya,
you are probably not seeing enough jolt just because you are not dealing enough of an impact to jolt the NPC. With PuppetMaster the puppets are normally using pinning forces to keep pinned to the animation, which unfortunately, but inevitably also dampers any incoming collisions. That is not what happens in real life, obviously there are no forces keeping us where we are other than the ones coming from our own muscles. That's why if a puppet intends to hit another puppet, you'll need to use additional force/damage. That is precisely why the Boosters have been implemented. In your character controller script, define a public Booster booster;, fill it in in the Editor, setting impulseMlp to a high value (loosens the other puppet mode) for the weapon muscle and immunity to 1 (infinite collision resistance) if necessary. Then, right before the weapon is supposed to hit in the animation, call booster.Boost(behaviourPuppet);
The effect of the booster will be faded out by the "Boost Falloff" of BehaviourPuppet over time.

Click to expand...

Thanks for the information..

I should point out that shooting a weapon for me involves throwing a raycast into space, and seeing if it collides. Prior to PuppetMaster if a hit occurs I resolve the collision down to the correct enemy NPC script and call a method on that (which applies damage and does some impact animation or dead, etc.)

With PuppetMaster, if I use the booster cab I apply the force using Rigidbody.AddForceAtPosition() on the Puppet's RB (the one that was returned as a result of the Raycast).

In addition, should I get the booster to target only the RB's (and connected muscles)?

Hey, could you tell me in a bit more detail, what is the situation and the state of the puppet at the time you need to switch update mode. Also, at what time percisely in the frame are you calling for that change? I mean from Update, LateUpdate or something else?

Pärtel

Click to expand...

Seems I got it working if I wait a frame to change. I suppose, initially I was actually calling it on contact. New problem, when the animator is in Normal mode, there is a jitter but only on 144hz monitors, 60hz is butter smooth.

Ref. In the 'Stagger (Final IK)' scene, the character's mass set to 750,
1. The masses of 'ragdoll' are all set to 750.
2. Set 'Muscle Spring' to '650' and 'Muscle Damper' to '250' for 'PuppetMaster'.
3. We set 'Collision Resistance' of 'Behavior Puppet' to 500.
4. The mass of the ball is set at 50 ~ 80.

Could you try again with the camera problem from the last patch (Fixed Late Update)? I tried on another PC with fresh Unity and PM and cam sync flickering still exist

EDIT: I noticed the problem can be seen only when there is a +50 fps. When it is below, it is wonderful. It's related with Fixed Timestep - when change it from default 0.02 to 0.01, it is smooth with fps <100.

Hey,
About the last paragraph, what kind of doc/tutorial exactly would you need? About 2 characters fighting each other?
Adjusting pin weight and muscle weight on individual muscles does have an effect in Unmapped mode, you are just not seeing it, as the character is not mapped to the ragdoll. Select the PuppetMaster gameobject and see the behaviour of the ragdoll change in the Scene view as you adjust those weights in Unmapped mode.
Pärtel

Click to expand...

Partel,

So I have about a 3 page document I have been updating as I discover things about combat and collisions. Let me clean it up a little and I'll post it or if you prefer, I can PM you because I may be wrong on some stuff and I wouldn't want to mislead other users. Just let me know.

Well that's strange. When my puppet is in unmapped mode, the ragdoll colliders do indeed adjust when I change the Pin Weight and Muscle Weight but the mesh continues to follow the animated pose so I wasn't seeing the difference. What I can't figure out is why your Melee Pilot Puppet in the Melee Demo acts differently in UnMapped mode than my puppet. When I adjust Pin Weight and Muscle Weight on your pilot puppet, both the colliders and mesh adjust while in unmapped mode. Do you have an idea of what the difference may be?

Let me know if you want me to pass that Combat/Collisions doc to you. You may find it humorous reading.

I should point out that shooting a weapon for me involves throwing a raycast into space, and seeing if it collides. Prior to PuppetMaster if a hit occurs I resolve the collision down to the correct enemy NPC script and call a method on that (which applies damage and does some impact animation or dead, etc.)

With PuppetMaster, if I use the booster cab I apply the force using Rigidbody.AddForceAtPosition() on the Puppet's RB (the one that was returned as a result of the Raycast).

In addition, should I get the booster to target only the RB's (and connected muscles)?

James

Click to expand...

Hey,
You should use the booster on melee cases only, use it on muscles that become in contact with the enemy, like the weapon and perhaps the hand and arm if necessary. You can also use AddForceAtPosition to deal additional blow when there is a contact between the weapon and the enemy. Use Rigidbody.GetPointVelocity with collision point to find the force vector on the weapon.

Seems I got it working if I wait a frame to change. I suppose, initially I was actually calling it on contact. New problem, when the animator is in Normal mode, there is a jitter but only on 144hz monitors, 60hz is butter smooth.

Click to expand...

Hey,
Havent tested it on monitors with different frequencies, must be the camera updating being out of sync with the updating of the object it is tracking. Can you tell me some more, do you have interpolation on the rigidbodies? Are you using Update or FixedUpdate to move the character? Do you have smooth following enabled on the camera? What do you see when you set time scale to 0.1 or smaller?

Ref. In the 'Stagger (Final IK)' scene, the character's mass set to 750,
1. The masses of 'ragdoll' are all set to 750.
2. Set 'Muscle Spring' to '650' and 'Muscle Damper' to '250' for 'PuppetMaster'.
3. We set 'Collision Resistance' of 'Behavior Puppet' to 500.
4. The mass of the ball is set at 50 ~ 80.

Ps. I am not fluent in English.

Click to expand...

Hey,
You'll need way more muscle spring for that kind of mass.
I got it to stagger with muscle spring at 50 000, damper at 5 000. Also set "Damper For Spring" to 0 in the BehaviourBiperStagger's "Balancer Settings".

Could you try again with the camera problem from the last patch (Fixed Late Update)? I tried on another PC with fresh Unity and PM and cam sync flickering still exist

EDIT: I noticed the problem can be seen only when there is a +50 fps. When it is below, it is wonderful. It's related with Fixed Timestep - when change it from default 0.02 to 0.01, it is smooth with fps <100.

Thanks
Karol

Click to expand...

Hey, I'm still working on making a proper solution for the camera syncing. Will take some time though, there are so many variables to consider and it's very difficult to debug, hold on..

So I have about a 3 page document I have been updating as I discover things about combat and collisions. Let me clean it up a little and I'll post it or if you prefer, I can PM you because I may be wrong on some stuff and I wouldn't want to mislead other users. Just let me know.

Well that's strange. When my puppet is in unmapped mode, the ragdoll colliders do indeed adjust when I change the Pin Weight and Muscle Weight but the mesh continues to follow the animated pose so I wasn't seeing the difference. What I can't figure out is why your Melee Pilot Puppet in the Melee Demo acts differently in UnMapped mode than my puppet. When I adjust Pin Weight and Muscle Weight on your pilot puppet, both the colliders and mesh adjust while in unmapped mode. Do you have an idea of what the difference may be?

Let me know if you want me to pass that Combat/Collisions doc to you. You may find it humorous reading.

Allan

Click to expand...

Hey,
Perhaps it's the "Min Mapping Weight" of some muscle groups set to 1 in BehaviourPuppet's "Group Overrides", which would cause those muscles to be mapped even if in unmapped mode?

I'd be very happy to take a look at your combat collisions doc, would be a great outline for simplifying stuff and improving the docs and tutorials!

Hey,
Perhaps it's the "Min Mapping Weight" of some muscle groups set to 1 in BehaviourPuppet's "Group Overrides", which would cause those muscles to be mapped even if in unmapped mode?
Cheers,
Pärtel

Click to expand...

Thanks. It was the "Min Mapping Weight" that was set to 0 in the group overrides on my character. I set it to 1 and now both the Ragdoll Colliders as well as the mesh renderers are effected when I change Pin Weight and Muscle Weight while in Unmapped mode.

In the Stagger system from Beta v0.6, are the stagger behaviors supposed to save the puppet from falling over, or is it only for the procedural animations?
Reading the code, it appears that they are supposed to try to keep the puppet balanced, but in the demo scene, the puppets never exit the stagger behavior state without falling over. Is recovering from staggering a planned feature that's not fully implemented yet? Or could this be an issue with the configuration in the demo scene?

In the Stagger system from Beta v0.6, are the stagger behaviors supposed to save the puppet from falling over, or is it only for the procedural animations?
Reading the code, it appears that they are supposed to try to keep the puppet balanced, but in the demo scene, the puppets never exit the stagger behavior state without falling over. Is recovering from staggering a planned feature that's not fully implemented yet? Or could this be an issue with the configuration in the demo scene?

Thank you,
Michael

Click to expand...

Hey,
The staggering was designed for just taking a couple of steps before just falling down, after having hopelessly lost balance, so the puppet would not appear to just give up and hit the ground. Recovering from it would be insanely difficult to achieve, but I'll look into it in the future.

After setting up puppet master, my character doesn't have "Revert" button anymore and that is a big problem for me. because I need to use this every time I change my character model in 3d softwares. When there is no "Revert" button I have to set up all setting again.

I attached a pic of section I'm talking about.

Attached Files:

After setting up puppet master, my character doesn't have "Revert" button anymore and that is a big problem for me. because I need to use this every time I change my character model in 3d softwares. When there is no "Revert" button I have to set up all setting again.

I attached a pic of section I'm talking about.

Click to expand...

When setting up the ragdoll and PuppetMaster, make a duplicate of the character, make the duplicate a ragdoll and add PuppetMaster to the duplicate and assign the original as the "Target Root" before clicking "Set Up PuppetMaster".

Hey, right now I'm making a vr game, with melee combat. For this purpose, I'm using finalik & puppetmaster. After pickup, weapons are driven via puppet master prop, attached to a hand, a hand is handled with VRIK. I want to create a two-handed weapon, that would look like you are holding it with two hands, and apply physics (hit another ragdoll) without flickering. Could you please clarify how I can reach such a behaviour. I’m thinking about changing proproot rotation, making it looking on another hand, may that work ?

There is TwoHandedProp in Puppetmaster asset, I have not succeeded in using it, yet. Is it making the thing I need?

---
Update:
Looks like rotating the hand target, child of vr controller is the way it could be done.
Update #2:
It works, but additional pin cause weapon trembling, how it could be fixed =) ?

Oops...

"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.