Search Unity

  1. Going to #UniteBerlin? Bring a buddy & get 25% off the 2nd ticket! More info here.
    Dismiss Notice
  2. Famed game designer and creator of The Sims, SimCIty, and Spore is looking for a 3D artist to join their team. Join the challenge.
    Dismiss Notice
  3. Unity 2017.4 has arrived! Read about it here.
    Dismiss Notice
  4. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  5. Magic Leap’s Lumin SDK Technical Preview for Unity lets you get started creating content for Magic Leap One™. Find more information on our blog!
    Dismiss Notice
  6. We've opened a new World Building sub-forum to faciltate all your world building discussions! Drop in and ask any ProBuilder, ProGrids, or PolyBrush questions.
    Dismiss Notice
  7. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

PuppetMaster - Advanced Character Physics Tool [RELEASED]

Discussion in 'Assets and Asset Store' started by Partel-Lang, Oct 1, 2015.

  1. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,602
    Hey,
    Not sure if I understood... Is the problem with the puppets not being able to get up and losing balance repeatedly because of colliding with other puppets? In that case you should increase the "Get Up Collision Resistance", "Get Up Regain Pin Speed Mlp" and "Get Up Knock Out Distance" under BehaviourPuppet.
     
  2. somosky

    somosky

    Joined:
    Feb 15, 2014
    Posts:
    60
    Hi. So I'm going to try to explain this correctly but I'm not exactly sure how to explain it. I'm currently using Puppet Master with Unitys AI agents. About 90% of the time everything works perfectly. However about 10% of the time the Rag doll and the AI agent get "detached" from each other where let's say the Rag doll runs into a wall and the AI Nav Agent continues through the wall. Now I'm aware this particular issue can be fixed with rebaking the Nav Mesh to include this wall but this also happens at other random times.

    So my question is is there a simple way to say if the rag doll is too far away from the animated character to teleport the rag doll to the position of the animated character? Almost like a fix if one it too far away from the other?
     
  3. beowulfkaine

    beowulfkaine

    Joined:
    Apr 3, 2014
    Posts:
    125
    I'm looking at the demo scene called Melee Spherical in PM and it says to grab the prop and hit the bears with E. When I do this, the prop just goes through the bear and soldier. Am I missing something?
     
  4. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,602
    Hey, sorry for the delay.

    You'll have to disable the nav agent while behaviourPuppet.state != BehaviourPuppet.State.Pinned, it should not be moved or rotated at this time. When the puppet gets up, BehaviourPuppet will automatically move the character to the position of the ragdoll.

    Hey,
    This can happen if you import PuppetMaster to a project where you have changed the Layer Collision Matrix. Try importing to a new project.

    Cheers,
    Pärtel
     
  5. somosky

    somosky

    Joined:
    Feb 15, 2014
    Posts:
    60
    I noticed under the Puppet behaviors there's a way to send a message when the Puppet looses balance etc. Would that be a good place to do that or is there a way from the Puppet master script to send a message when Pinned is false? Or would I need to code that myself?

     
  6. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,602
    Hey,
    Yeah, that's what those events are for.
    If you need to do something continuously while unpinned, you could maintain a reference to the BehaviourPuppet component
    Code (CSharp):
    1. public BehaviourPuppet puppet;
    and check it's state:
    Code (CSharp):
    1. if (puppet.state != BehaviourPuppet.State.Pinned) {
    2. // Do something while the puppet is unpinned or getting up.
    3. // Just don't move/rotate the character controller, BehaviourPuppet should have exclusive control over that during Unpinned/GetUp states.
    4. }
     
  7. cspid

    cspid

    Joined:
    Apr 25, 2014
    Posts:
    7
    Hi Partel,
    I'm having an issue where on behaviour fall, the target pose moves down beneath the player and the ground, and when he tries to get up it drags the character through the ground and offscreen. Before the character loses balance it can walk around normally. Any suggestions?

    Thanks Screen Shot 2018-03-23 at 2.49.57 AM.png Screen Shot 2018-03-23 at 2.55.39 AM.png
     
  8. m4ng4

    m4ng4

    Joined:
    Apr 17, 2013
    Posts:
    4
    Hi,

    Verry nice tool here, havent tested it much.
    so just a question is there a tutorial for how to make this possible? or could anyone point me in the right direction?
    My character dosent have any legs just the upper boddy and puppetmaster wont let me create the puppet becouse the legs are missing.

    Br,
    Daniel
     
  9. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,602
    Hey,
    Are you sure you have the layer of that ground collider included in BehaviourFall's "Raycast Layers"?

    Hey,
    Did you mean you are unable to create the ragdoll without legs using the BipedRagdollCreator?

    You could add empty gameobjects as "legs", create the ragdoll, then just delete them.

    Best,
    Pärtel
     
  10. m4ng4

    m4ng4

    Joined:
    Apr 17, 2013
    Posts:
    4
    Was thinking on trying that out right now..
    So simple!

    Thanks!
     
  11. cspid

    cspid

    Joined:
    Apr 25, 2014
    Posts:
    7
    Yes, Behaviour Fall's raycast layer is set to the ground layer but the problem remains
     
  12. Morseliot

    Morseliot

    Joined:
    Jan 10, 2015
    Posts:
    15
    Hello Partel,
    I'm working on multiplayer game using your solution (great tool by the way). Managed to sync falls, but can't find the way how to sync get up operation, could you please advice which direction I should move? Probably I need to call UNet function in unity event section of Behaviour Fall "On End", but how do I determine which side the player should play animation or is there something already pre-setup that I might use?
    Alex
     
  13. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,602
    Hey,
    Do you have any code that changes the character position while BehaviourFall is enabled?
    If that's not it, any chance you could send me a repro project or something so I could take a closer look?

    Hey,
    It would be best if state switching was controlled by the owner of each puppet. So you set Collision Resistance to Mathf.Infinity for the remote puppets and RPC a behaviourPuppet.SetState(BehaviourPuppet.State.Unpinned) from the owner to all others when it falls over. In a similar way, set BehaviourFall.canEnd to false for the remote puppets, and RPC to enable it when BehaviourFall invokes the "On End" event on the owner's side.

    Best,
    Pärtel
     
  14. Junk1212

    Junk1212

    Joined:
    Mar 27, 2018
    Posts:
    2
    Hello!
    I'm using puppet master to realize a 3d platform. The character is set just like the soldier in your demo (with Capsule Collider). The player needs to jump on slightly inclined platforms. When the jump is performed the character does not put his feet on the platform because of the capsule. Have you some suggestions for me? Maybe the capsule solution is right for a walking character, but not for a jumping one.

    Thanks in advance.
     
  15. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,602
    Hey,
    Looks like you need some IK foot placement correction. That video shows the Grounder that is a part of my other asset, Final IK. There are other cheaper products for foot placement on the Store too if that's all you would ever need IK for, but I can't guarantee they will work seamlessly with PuppetMaster.
     
  16. Junk1212

    Junk1212

    Joined:
    Mar 27, 2018
    Posts:
    2
    Thanks for the answer. I will use Final IK.
    I still need a capsule collider to keep the character standing?

    Thank you
     
  17. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,602
    You'll still need the capsule collider to keep the character from falling through the platforms, yes. The Grounder only works on the bone level as a cosmetic layer on top of the animation.
     
  18. yuyorke

    yuyorke

    Joined:
    Nov 4, 2016
    Posts:
    2
    Hello,
    I'm enjoying Puppet Master and Final IK, they are amazing tools.
    By the way I need my character to take a bar/stick, something like the ninja turtle in the picture.
    So two hands, to points.



    Of course the hands should properly move the bar, they are already animated.

    Is this possible with the Puppet Master Props?
    Or should I use the Interaction System?
    Or a combination of both?

    Thank you
     
    Last edited: Apr 4, 2018
  19. Useless-Media

    Useless-Media

    Joined:
    Apr 19, 2015
    Posts:
    83
    Hello Partel,

    What is the best way to simulate a Bullet Impact or a explosion of a Granate on the Character Body?

    I have now a little setup with Puppet Master and Final IK, when i have a explosion i clear up the radius and including the bones which need to be changed, then i spawn for each bone which is effected a dummy GameObject with a Rigidbody on it, i add explosion force to this dummy GameObjects and let do Final IK the work with the FullBodyBipedIK by let the IK follow the effected dummy GameObjects.
    GranadeTest.gif

    But this is all a little glitch, most of the time it looks strange and unrealistic.

    Can i make something with puppet master or behaviour puppet maybe a offset you can add to the muscles or is there a function which helps me to make a good explosion?

    EDIT: I searched a little in the Forum and found Broadcaster.Hit() i think its possible with a little math calculating the force and the position but before i start and do something wrong let me know if there is already a build in way i can walk with my explosions

    EDIT AGAIN: Its working now with MuscleCollisionBroadcaster.Hit(float unPin, Vector3 force, Vector3 position) but can you tell me how i calculate the unPin variable based on the Force?
     
    Last edited: Apr 5, 2018
  20. Useless-Media

    Useless-Media

    Joined:
    Apr 19, 2015
    Posts:
    83
    Partel,

    I changed the Muscle Hit behaviour to:
    Code (csharp):
    1.  
    2. public void Hit(float unPin, Vector3 force, Vector3 position, bool isTraining) {
    3.             if (!enabled) return;
    4.             foreach (BehaviourBase behaviour in puppetMaster.behaviours) {
    5.                 behaviour.OnMuscleHit(new MuscleHit(muscleIndex, unPin, force, position, isTraining));
    6.             }
    7.         }
    8.  
    Added the isTraining bool
    With this change i have the option to use weapons which makes no damage but still effecting the Body, then i can make something like:
    Code (csharp):
    1.  
    2. void OnMuscleHit( MuscleHit hit ) {
    3.             if ( !hit.m_IsTraningsHit )
    4.             {
    5.                 Health -= CalculateDamage( hit.muscleIndex, hit.unPin * 0.5f );
    6.             }
    7.         }
    8.  
     
    Last edited: Apr 5, 2018
  21. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,602
    Hey, sorry for the delay, I was on a short vacation.
    Do you have animations to use that bar/stick?. It would probably be easier to use a traditional animation, using the InteractionSystem together with all that PuppetMaster Prop stuff would probably make everything very complicated.
    You can use the Prop system for 2-handed props though, you'll just to connect the other hand to the prop with a joint too.

    Hey,
    The unpin value can't really be calculated, it should be empirically found by testing out smaller and larger values and seeing what works best.
     
  22. Anusain_Mv

    Anusain_Mv

    Joined:
    Jan 6, 2017
    Posts:
    4
    Hello @Partel-Lang ,
    i am using puppet master for the enemy in VR game and till now everything is working fine.
    when i am grabbing the enemy in VR with my hand and its working but their are some issues like i have put angular limit when my enemy is at dead state but in VR when i am shaking the enemy its breaking the limits and how i can make the enemy more stiff in dead state.
    i want to do just like in robo recall we do when we grab the enemy and shake it.
     
    Last edited: Apr 9, 2018
  23. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,602
    Hey,
    If the limits are breaking, it means PhysX just can't handle the forces applied to the joints (joints in Unity are especially bad since Unity 5). You should increase "Solver Iteration Count" for the shaking puppet.

    You can make the enemy more stiff in dead state by increasing "Dead Muscle Weight" under PuppetMaster's "State Settings".
     
  24. h00man

    h00man

    Joined:
    Apr 17, 2017
    Posts:
    23
    hey partel,
    i'm using a simple script for shooting bullets with raycast.
    i was wondering how can i tell the puppet to be effected by the raycast bullets?
    something like a ball shooter script which is attached to camera in the puppet extended scene ,but this time instead of ball game objects i need the puppet to be unpinned by raycast.does puppet master only respond to game objects in certain layers?
     
  25. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,602
    Hey, please take a look at the "Puppet Raycast Hit" demo and the script used in that is RaycastShooter.cs.
     
  26. unity_kony_X_JrICrmQ

    unity_kony_X_JrICrmQ

    Joined:
    Wednesday
    Posts:
    1
    Hi Partel, are there any plans on inVector Integration.
    it works to some extend with Basic Locomotion template but things like the crouch animation, and Roll are not working probably.
    When Crouching for instance the character is just sliding around and not playing The Moving While Crouching animation unless u disable the puppetmaster component or make the puppet kinematic or disabled.
     
    Last edited: Apr 18, 2018 at 2:07 PM
  27. Weendie-Games

    Weendie-Games

    Joined:
    Feb 17, 2015
    Posts:
    33
    Hi @Partel-Lang , i know my issue is not directly related to PuppetMaster (is related to the A pose, but on T pose i get other issues with my custom clothing system), but i'm getting wrong colliders rotation attached to the ragdoll joints.

    It is possible to rotate the colliders after the creation with the Ragdoll Editor?
    upload_2018-4-18_11-2-32.png

    Something like this:
     
    Last edited: Apr 18, 2018 at 3:44 PM
  28. Useless-Media

    Useless-Media

    Joined:
    Apr 19, 2015
    Posts:
    83
    Hey, Patel

    I need your help again, i have set up some Dummies with Puppet Master and Behaviour Puppet.

    It looks like the Player is always Stronger then the dummy
    PlayerStronger.gif

    How can i have the same Resistance on both characters?