Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more..
    Dismiss Notice
  3. Dismiss Notice

PuppetMaster - Advanced Character Physics Tool [RELEASED]

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

  1. Deckard_89

    Deckard_89

    Joined:
    Feb 4, 2016
    Posts:
    314
    In indoor areas, I often have problems with the player character's puppet firing through the roof (even though colliders are present) and out of the playable area. Not sure how to solve this - all puppet rigid bodies are set to interpolate.
     
  2. Keegan_ORourke

    Keegan_ORourke

    Joined:
    Jun 22, 2015
    Posts:
    5
    I am trying to use UCC + Puppet Master + Final IK.

    So far I can get either or working great with UCC. Well, to be specific, I can get both working together I think, but not the FBBIK Grounder, which is the main reason I want Final IK for this character.

    I went though and set up a FBBIK Grounder on the Puppet Master Extended scene character to make sure I was doing it right. It works great there!

    So it seems to be probably an issue with the UCC Final IK Bridge script or something similar. I notice that inside that script there is reference to most Final IK components, but not the Grounder.

    Does anyone know how to get UCC + Puppet Master + Final IK's FBBIK Grounder all working together? (My character is humanoid, nothing special)
     
  3. Keegan_ORourke

    Keegan_ORourke

    Joined:
    Jun 22, 2015
    Posts:
    5
    upload_2020-8-16_12-13-22.png
    Here's the non-UCC character working just fine!

    But when I try the same with a UCC character, it's either Puppet Master or the grounder.

    I have a feeling this has to do with the way the Final IK Bridge script for UCC disables the FBBIK component, because when I disable that component for this working character, naturally the Grounder stops working.
    upload_2020-8-16_12-15-24.png
    Perhaps we can just add Grounders the to Final IK Bridge script?

    However, this seems like not really the answer, since the grounder works just fine with UCC if I simply turn off Puppet Master.
     
    Last edited: Aug 16, 2020
  4. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,521
    Hey,
    You can tweak that when you expand "State Settings" in PuppetMaster, increase the value of "Dead Muscle Weight".

    Hey,
    I'll check out your project today, hold on please...

    Hey,
    Bullets can skip narrow colliders when they travel fast, are you using OnCollisionEnter or raycasting to detect the bullet hits?
    Should be done by raycasting.

    Hey,
    The UCC FIK bridge was developed by Opsive guys, so I don't know much about it, sorry, you'll probably get a better answer about that from them. About PuppetMaster, there is a recent integration package available, or did you already get started with that?

    Best,
    Pärtel
     
    Last edited: Aug 19, 2020
  5. ferverence

    ferverence

    Joined:
    Jul 15, 2014
    Posts:
    56
    Hello. I would like to slowly move another rigidbody against a puppet that is on an animated character- When I attempt that now, the puppet jitters as if trying to match where the animation is. Are there any blend parameters to have the puppet gently slide around the object as opposed to constantly trying to get where the animation is trying to go?
     
  6. Deckard_89

    Deckard_89

    Joined:
    Feb 4, 2016
    Posts:
    314
    @Partel-Lang Sorry, I should have explained better. There are no bullets involved, I meant that the character sometimes passes through the roof/wall colliders if his puppet is knocked over at great speed, eg from a collider collision that's part of a fast enemy attack animation.

    I managed to circumvent this by placing extra colliders above the ceiling, but it means I must go into every scene to do the same with every ceiling.
     
  7. gliealonso

    gliealonso

    Joined:
    Oct 21, 2018
    Posts:
    114

    Maybe try increasing the weight of the puppet using Ragdoll Editor script.
     
    Deckard_89 likes this.
  8. Milionario

    Milionario

    Joined:
    Feb 21, 2014
    Posts:
    129
    My staggering puppet encounters several obstacles in its staggering path, thus colliding with them and turning the puppet around, which is expected after all. But how do I rotate him to correct the effect these collisions had on him? For example I want to force him to stagger always facing world Z, so i need to force his spine to rotate towards Z direction? I believe I actually asked this here but I can't find my post anymore.
     
  9. ferverence

    ferverence

    Joined:
    Jul 15, 2014
    Posts:
    56
    One more question. I have a character that goes through the world here you basically watch whats going on. In the case of sitting on a chair at a desk animation, the feet go crazy because they're trying to push through the floor. Would be great if they could just slide to wherever they can without trying to clip the floor trying to match the animation. Is there a means to accomplish this? I'd like to be able to do this without modifying animations, and instead let the puppet decide whats best. Thanks again.
     
  10. alsomitra

    alsomitra

    Joined:
    Aug 31, 2017
    Posts:
    33
    Hey @Partel-Lang
    When I use "DisconnectMuscleRecursive" to cut off the head, the mesh of the Upper chest stretches.
    I'm wondering if there are any good solutions.
     
  11. Deckard_89

    Deckard_89

    Joined:
    Feb 4, 2016
    Posts:
    314
    Increasing mass doesn't help I'm afraid. Puppet is still able to pass through colliders for some reason.
     
  12. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,521
    Hey,
    Yeah, that is the pinning forces trying to pin the ragdoll to the animation fighting the collision depenetration forces, causing the jitter. You'll have to temporarily decrease those pinning forces when a collision happens. That is what BehaviourPuppet already does when it collides with anything included in it's "Collision Layers". Make sure your rigidbody's layer is included in collision layers. If it already is, try reducing "Collision Resistance".

    Hey,
    Still the same issue, fast moving rigidbodies can skip thin colliders. Happens when the collider neatly fits between the position of the rigidbody at physics simulation step n and n+1. With Discrete collision detection mode the collider will simply be skipped.
    Could use ContinuousDynamic collision detection mode (slow) on the ragdoll rigidbodies or reduce fixed time step, but the best option would still be to make world colliders thicker.

    Hey,
    Can't think of any other solution other than adding some torque to the spine rigidbodies. Check out RootMotion.Dynamics.PhysXTools.cs, has a bunch of cool physics math to help with that.
    For example this code would make the chest rigidbody rotate towards the rotation of the gameobject it is attached to:

    Code (CSharp):
    1. public Rigidbody chest;
    2.     [Range(0f, 10f)] public float weight = 1f;
    3.  
    4.  
    5.     private void FixedUpdate()
    6.     {
    7.         Vector3 torque = PhysXTools.GetAngularAcceleration(chest.rotation, transform.rotation);
    8.         chest.AddTorque(torque * weight, ForceMode.VelocityChange);
    9.     }
    Hey,
    When they are sitting, could just unpin the legs:
    Code (CSharp):
    1. puppetMaster.SetMuscleWeightsRecursive(HumanBodyBones.LeftUpperLeg, 1f, 0f);
    2.         puppetMaster.SetMuscleWeightsRecursive(HumanBodyBones.RightUpperLeg, 1f, 0f);
    To reset, call the same methods with 1f for the last parameter (pin weight multiplier).

    Also, if you happen to have Final IK, using the GrounderIK automatic foot placement correction would help with feet penetrating surfaces also in other situations like running around on terrain.

    Hey,

    There are a number of mesh slicing tools on the Store, but as far as I know none of them can make sure vertices skinned partially to the neck and partially to the head don't get stretched to the severed head as it flies away. Slicing meshes at runtime is also slow and produces a lot of GC alloc, since there is no way to modify meshes in realtime without serious GC alloc and resulting GC spikes.

    I have edited the discontinued Limb Hacker tool by Noble Muffins (MIT licence) to to cut a SkinnedMeshRenderer properly in Editor at pre-defined joints (only elbows, knees and neck are currently supported). That is 5 cut points and results in 32 possible permutations for the base mesh + 5 severed body part meshes. 5 cuts is pretty limited, but at least it has virtually zero performance cost at runtime.

    Here's the package if you are interested in trying that. There are 2 scenes included - "Mesh Hacker", that is the scene where you produce the pre-cut meshes and "PuppetMaster Example" is about using them together with PuppetMaster.

    It doesn't create infills for the wounds, but since they are cut at just 5 points, you can create wound meshes, use them to cap the wounds. That also will look much better than a procedural mesh infill.

    Cheers,
    Pärtel
     
    Deckard_89, ferverence and Milionario like this.
  13. alsomitra

    alsomitra

    Joined:
    Aug 31, 2017
    Posts:
    33
    Hey @Partel-Lang
    Thank you very much. I appreciate it.
    By the way, I have one more question.
    When BehaviourBipedStagger is on its own, it loses its balance when it tilts on the ground with a fun movement.
    I want to make BehaviourPuppet and BehaviourBipedStagger do the same movement.
    Could you please let me know if there is a better way to do this?

    And He can't regain his balance when the slope flattens out.
    If possible, he wants to regain his balance when it flattens out.
     
    Last edited: Aug 27, 2020
  14. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,521
    Hey,
    BehaviourPuppet can't do what BehaviourBipedStagger does. But they can be used together. In the stagger demo you'll see 2 pilots, one is using just Stagger and the other has both BehaviourPuppet and Stagger. When BehaviourPuppet loses balance, it just switches to Stagger. See how BehaviourPuppet there has "BehaviourBipedStagger" as "Switch To Behaviour" in it's "On Lose Balance" event. You can move the behaviours from that demo to your own puppet.

    I have tried numerous ways to make re-balancing work, haven't been able to make it happen, sorry. Always looks weird when I just blend from physics based stagger back to animation.

    Best,
    Pärtel
     
  15. TooManyPotatoes

    TooManyPotatoes

    Joined:
    Apr 11, 2014
    Posts:
    6
    Hey @Partel-Lang

    I was wondering what your thoughts were on the viability of using this package for a multiplayer game with around 10 total players and around 50 or so NPCs, all of which would be using active ragdolls. I would want the puppets to be accurately synced across each client for proper hit reg. Do you think this could be achieved or would PuppetMaster be too taxing in this environment?
     
    Last edited: Sep 1, 2020
  16. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,521
    Hey,
    You can keep PuppetMaster in Disabled mode (all ragdoll stuff deactivated) while you don't need it, so it really is not about the total number of characters, but the number of simultaneously active ones and how much they are in contact with each other. If you can keep that around max 10 or so, you should be fine. Also depends on how much overhead you have from other stuff going on in the game of course. But syncing ragdoll physics is pretty heavy on the bandwidth too so have to consider that as well.

    Best,
    Pärtel
     
  17. Drumsmasher17

    Drumsmasher17

    Joined:
    Jun 3, 2015
    Posts:
    7
    Hi @Partel-Lang

    We're making a VR shooter and noticed while trying to make puppetmaster-driven "hit reactions", that the MuscleCollisionBroadcaster.Hit() had very different results when in a VR scene compared to the demo scenes (ragdoll 'pings' back much quicker, looks more like "jitter")

    We narrowed it down to something on the default SteamVR player object, namely it changing the Time.fixedDeltaTime :
    upload_2020-9-3_4-34-11.png

    I tried it in the demo "Raycast Hit" scene, with a toggle to change the fixed delta time (No VR player running in video):


    I tried tweaking the Pin and Force settings for the RaycastShooter, and can't seem to quite replicate the original behaviour when using the lower value. Furthermore, I expect this might become an issue, as PC VR headset options currently range from 72hz (quest via USB link) and 144hz (Valve Index, etc).

    Do you have any suggestions on how we should proceed?

    (EDIT: Should add, we're using version 0.9).

    Thanks, -TB
     
    Last edited: Sep 4, 2020
  18. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,521
    Hey.

    FixedDeltaTime has the most effect on Muscle Spring. Lower delta time makes muscle spring stronger as joints are solved more often. So I would suggest reducing the value of Muscle Spring in PuppetMaster by the same value you multiply fixed delta time with. For example if your default value for Muscle Spring is 100, could use this code:

    puppetMaster.muscleSpring = 5000f * Time.fixedDeltaTime;

    So that returns 100 for fixed delta time of 0.02 and 50 for 0.01.

    Best,
    Pärtel
     
  19. Drumsmasher17

    Drumsmasher17

    Joined:
    Jun 3, 2015
    Posts:
    7
    Awesome! That sounds like a likely fix.
     
  20. lordsamain

    lordsamain

    Joined:
    Jun 17, 2018
    Posts:
    14
    Hi :) I begin to use PuppetMaster on my VR project. Really awesome Asset ! I would like to know if it's possible to have only physics on the arms and hands and the rest of the tranforms on iskinematic ? Thx :)
     
  21. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,521
    Hey,
    Check out the "VR Boxing" demo in Plugins/RootMotion/PuppetMaster/_Integration folder (requires Oculus utilities too). That uses not full body physics, but just 2 rigidbodies for the hands. Those rigidbodies follow the hand controllers by physical forces only. If you want full body avatar instead of floating hands, will have to use VRIK (Final IK) on top of that.
    This is how most of the VR physics based games like Blade & Sorcery and Boneworks have done it and I'd recommend it myself over using full body PuppetMaster because of better stability, performance and time required for development.

    Cheers,
    Pärtel
     
  22. nubdev

    nubdev

    Joined:
    Mar 30, 2013
    Posts:
    85
    Hi Pärtel,
    Is there an inbuilt way to recognise if a puppet has lost balance due to being hit with a prop? For example in the melee demos, using the melee prop against bot puppets. I am just wondering if I have to write custom logic here or not.

    Thanks
     
  23. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,521
    Hey,
    Yeah, just check behaviourPuppet.state.
    if it returns BehaviourPuppet.State.Unpinned, then the puppet is unpinned (lost balance).

    You can also use the events on the bottom of BehaviourPuppet. Add a UnityEvent listener to the "On Lose Balance" event and you will get a call whenever the puppet is knocked out.

    Best,
    Pärtel
     
  24. nubdev

    nubdev

    Joined:
    Mar 30, 2013
    Posts:
    85
    Thanks for the reply. I should have been clearer. Is there a way to know when it has lost balance / been unpinned due to specific circumstances, such as being hit by a melee prop? The problem with "On Lost Balance" events is that its being called even when falling over obstacles or other ragdolls.
     
  25. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,521
    No, BehaviourPuppet actually loses balance only on one condition and that is when a muscle drifts too far from it's animated target. There can be a number of things contributing to that simultaneously - melee hit, stumbling into something or sudden change of animation or direction. But you could use behaviourPuppet.OnCollisionImpulse() delegate to get a call from BP when it is damaged by something:

    Code (CSharp):
    1. void Start() {
    2. behavioudPuppet.OnCollisionImpulse += OnCollisionImpulse;
    3. }
    4.  
    5. void OnCollisionImpulse(MuscleCollision m, float impulse) {
    6. float isMeleeHit = check m.collision.gameobject.CompareTag or whatever to see if it was a melee prop or something else.
    7.  
    8. if (isMeleeHit) lastMeleeDamageTime = Time.time;
    9.  
    10. }
    Then when the puppet is unpinned, check for Time.time - lastMeleeDamageTime and if it is less than a second or so, it was probably caused mostly by the melee hit.

    Best,
    Pärtel
     
  26. nubdev

    nubdev

    Joined:
    Mar 30, 2013
    Posts:
    85
    Thank you very much, that is what I needed.
     
  27. lordsamain

    lordsamain

    Joined:
    Jun 17, 2018
    Posts:
    14
    Thanks for your answer ! :)
     
  28. lordsamain

    lordsamain

    Joined:
    Jun 17, 2018
    Posts:
    14
    I also have Final Ik :) My problem is that I would like to have physics on my arms too, not only on my hands to avoid some strange effects when the physical anchor is stuck behind an object. I don't know if you see what i mean :)

    I have an another question. To move the character with active puppetmaster and final ik, do you recommend to make a character controler with rigidoby or can i use the transform of the parent to move the character ? Thanks for your help :)
     
  29. OmnifariousStudios

    OmnifariousStudios

    Joined:
    Mar 12, 2018
    Posts:
    45
    Hi again Partel!

    I saw on the freshDesk forum that you've listed Boneworks as using PuppetMaster?! That's incredible, congrats!

    Could you speculate on the puppetmaster settings and behaviour settings they may have used for their ragdoll enemies? I'd love to get my own puppetmaster project closer to that level if possible.
     
  30. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,521
    Hey,
    In that case yeah, could go for full body puppet, but you'll have another problem to worry about and that is joint stability. For example you might get a thin collider stuck between your hand and forearm collider and that could break up the entire ragdoll if you try to walk away from the door.

    About the character controller, yeah, you'll still need a rigidbody and a capsule collider for that. Btw I have this experimental PM-VRIK demo for Oculus, might be of help.

    Hey,
    I don't know exactly what they did or how they set it up, but they said they had changed something in the code too, not sure what. Have you checked out the "VR Boxing" demo under Plugins/RootMotion/PuppetMaster/_Integration?
    It has a VRPuppet.cs script, it is a drag and mapping weight modifier that works together with BehaviourPuppet and makes puppets in VR behave more realistic and less like rubber chicken. If you could send me a video of what you currently have, I might have some more specific suggestions for you about which parameter to tweak and so.

    Cheers,
    Pärtel
     
    OmnifariousStudios likes this.
  31. lordsamain

    lordsamain

    Joined:
    Jun 17, 2018
    Posts:
    14
    Thanks a lot ! I know that issue. Can i disable Preprocessing and enable Projection Mode on the puppet's joints ?
     
  32. OmnifariousStudios

    OmnifariousStudios

    Joined:
    Mar 12, 2018
    Posts:
    45
    Thanks so much as always!

    Yeah, I've tried out the VR Puppet script, and sometimes it works great but it depends on my other settings. Here's a video of my progress so far. I'm using Invector for AI, and VRIF for interactions.





    The silver ragdoll has the VRPuppet script attached and is set to 0.7 for both Pin weight Mlp and Muscle Weight Mlp. It looks pretty solid but the head is a little rigid on hits.

    The red ragdoll does not have the VRPuppet script attached, and is simply being affected according to the puppetmaster and behaviourPuppet components. You can see if definitely has a lot more of the rubber bounce effect than the silver. (I'm also not sure what that weird leg thing is that they've started doing)


    I'd love your suggestions on how to make these better and more solid, as well as your thoughts on the following issues:

    1. Right now when I grab any body part, I just unpin the whole puppet and move them around, but I'd like to be able to grab individual parts of the body and control it somewhat, like grabbing their arm and moving it out of the way so I can punch the head/chest. Would this just be a recursive thing where I Unpin the arms by a certain amount, and then re-pin them when I let go or they get too far away from me?


    2. I'm still getting a LOT of jitter when I'm grabbing them and then move too quickly. Even more jitter if I'm holding them and try to slam/push them into a wall. They go crazy and twist & move unpredictably. How to solve this so I can use the environment as a weapon similar to Boneworks and B&S?


    3. Any suggestions for giving the enemies some weight like in Boneworks or B&S? Or weight for objects in general I suppose.


    By the way, I'm using Physics Hands from VRIF, but could turn them off (or at least turn the colliders off) when grabbing if need be.

    Seriously, you are so awesome for being so helpful to your community and what you've done for the VR community as a whole.
     
  33. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,521
    Hey, you can disable Preprocessing but disabling projection is hardcoded into PuppetMaster because I noticed it can cause foot skating and other weird ragdoll glitches like the entire ragdoll starting to roll on the ground for no reason. So I'd rather force disable it than deal with lots of people asking why their ragdolls behave so weird hehe. If you still want to give it a try, look for joint.projectionMode = JointProjectionMode.None; in Muscle.cs and comment it out or force it enabled.

    Hey,
    Difficult to guess without being able to play around with the settings, but a few thoughts on reducing that rubber chicken effect:

    0.7 is quite a lot for Pin Weight Mlp, I mean I usually use 0.2 or something closer to that. 0.7 of pin force still pulls the muscle pretty strong. Could try also increasing the value of Pin Pow in PuppetMaster. That adjusts how strong pinning forces are applied depending on pin weight. For example value of 1 means it is linear, with 0.5 force applied for 0.5 pin weight. Value of 2 makes it an exponential curve (0.5 x 0.5 of force will be applied for 0.5 pin weight). Basically a higher value makes low pin weight apply less force.

    Could also try increasing Pin Distance Falloff. That reduces pin weight the farther the muscles are from their targets.
    So for when you are pulling the puppet from a hand, it will apply less and less pin force the farther you pull it, decreasing the changes of getting jitter.

    Another thing to try would be reducing Regain Pin Speed in BehaviourPuppet.

    What value are you using for Drag in VRPuppet? Have you tried significantly increasing that?

    About partial unpinning while grabbing, normally you would do it by reducing muscle.props.pinWeight for the body part that you are pulling. But VRPuppet already uses that parameter, it reduces pin weight for the muscles when they collide with anything. If you have all upper body muscle groups assigned to VRPuppet's Group Weights, that should already unpin the upper body when you grab an upper body muscle (using a lower Pin Weight Mlp value probably will help there too). Maybe try adding this to VRPuppet.cs:

    Code (CSharp):
    1. public void OnTouch()
    2.         {
    3.             damTime = Time.time;
    4.         }
    and call that every frame while grabbing to make sure VRPuppet is doing it's thing even when there is no actual collision between the hand and the puppet.

    About the jitter while pulling, can you also record a video of that please?

    About giving objects weight, it should be done by the script that moves your hands. I haven't tried Physics Hands myself, but looking at the videos doesn't it already have something built in for that? I'm sure you already tried increasing the mass of the objects/ragdoll rigidbodies?
    It might help to play around with the mass of your hands too... Link hand rigidbody mass to hand velocity, something like:

    handR.mass = 1f + handR.velocity.magnitude * something;

    So you have little strength while moving your hands slowly, but a lot of strength when you move it fast like when you try to punch a ragdoll.

    Cheers,
    Pärtel
     
  34. lordsamain

    lordsamain

    Joined:
    Jun 17, 2018
    Posts:
    14
    Thanks again !
     
  35. lordsamain

    lordsamain

    Joined:
    Jun 17, 2018
    Posts:
    14
    I still have some questions :) Is it possible to apply PuppetMaster only on the arms and hands for example to avoid unnecessary computations on other parts of the body?

    If not, can I leave the physical ragdoll on the arms and hands and other parts of the body on isKinematic or Disabled?

    If the PuppetMaster is active and I put 0 on the mapping weight on all parts of the body except arms and hands, is this more optimized?

    Thanks for your help :)
     
  36. Arcalise

    Arcalise

    Joined:
    Sep 27, 2019
    Posts:
    20
    Hey there! Great asset so far. I did have a quick question. I tried to create a ticket but it didnt send a confirmation so i'm unsure if it went through.

    The behavior scene in the clip below is taken in the new unity beta(2020.2). I also tested in 2020.1 with the same result.
    I did a fresh project with just puppetmaster imported and used the demo scene "Hanging" with these results.

    Any insights on this would be great! Thanks!

     
  37. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,521
    Hey,
    No, that is not possible sorry. Technically I imagine it would be doable, but it would probably triple the code base of PM, introduce many difficult bugs and pretty much defeat the purpose of saving up on performance.

    Having 0 mapping weight for the body wouldn't help save much.

    Hey,
    That is a general joint stability issue, not anything specific to PuppetMaster. When you move the handle in Editor with your mouse, that actually results in pretty rapid and violent forces on the ragdoll, as mouse input in Editor is not evaluated very smoothly. If it were to move smoothly, like driven by a script, it would not be that bad.
    Also, since you are using Unity 2020, you can go to Physics Settings and switch "Solver Type" to "Temporal Gauss Seidel". That is a new much more stable joint solver.

    Btw I see your ticket.

    Cheers,
    Pärtel
     
  38. lordsamain

    lordsamain

    Joined:
    Jun 17, 2018
    Posts:
    14
    Ok :) Thank you again for taking the time to answer me. Don't be sorry, I found a solution :)
     
  39. Censureret

    Censureret

    Joined:
    Jan 3, 2017
    Posts:
    361
    Hey guys. have anyone ever made a stable integration between puppetmaster and ootii character controller?

    I have attempted several times but it always resulted in some odd glitches. Now i have a usecase where i am throwing a spear at my enemies and puppet master could really really do a lot of good here but i can't get it to work. i have even attempted the "ootii puppet" script but it is just not working for me.

    Can anyone help me as this is really really important to my project
     
  40. Censureret

    Censureret

    Joined:
    Jan 3, 2017
    Posts:
    361
    This is basically what happens all the time
     

    Attached Files:

  41. ValiantTechStudios

    ValiantTechStudios

    Joined:
    May 10, 2020
    Posts:
    7
    Hello Partel-Lang.
    I have bought both PuppetMaster and Finak-IK. I think they are amazing pieces of software.
    If I have a character using both PuppetMaster and FullBodyBipedIK and I wish to set a pose for the character directly using the HumanPoseHandler.
    I ask as the pose seems to be overwritten by Puppetmaster if I make the call when the user of my application clicks on a GUI button. (I tested this by disabling puppetmaster for the character in question and the pose was correctly applied).
    I assume I need to store this pose and then apply it on one of the FullBodyBipedIK.solver or PuppetMaster delegates. Can you please let me know which one (and if possible why it must be done in that way)?
    Thanks
     
  42. sancha-km

    sancha-km

    Joined:
    Jun 5, 2016
    Posts:
    38
    Hi,
    What is the best way to setup more artistic swinging(to show feedback on hit on big distance), but avoiding puppet to lose balance and fall?
    Something like you can see in game of HALO shooter series.
     
  43. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,521
    Hey,
    I see Ootii has updated their tool and the demos in the integration package no longer work with the latest, I'll have to update those. But OotiiPuppet still seemed to work and set up the puppet alright. What exactly is going on in that png you posted? Could it be that the ragdoll layers are set to collide with the character capsule in the Layer Collision Matrix so the colliders conflict?

    Hey, thanks for the purchases!

    When setting the pose using HumanPoseHandler, it is important when that is done. You should use puppetMaster.OnRead delegate:

    Code (CSharp):
    1. void Start() {
    2. puppetMaster.OnRead += OnPMRead;
    3. }
    4.  
    5. void OnPMRead() {
    6. // do the posehandler suff here.
    7. }
    Hey,
    If I understood you right... you can probably get best results by combining physical puppet collision response with animation. So when your puppet gets hit, also play an animation of getting hit. There is some good stuff you can find on Mixamo for free, also some nice animation packages on the Asset Store.

    Cheers,
    Pärtel
     
  44. sancha-km

    sancha-km

    Joined:
    Jun 5, 2016
    Posts:
    38
    Yes i already try it, animation works slower, can i maybe set some value on Puppet master to faster recover from hit or make more amplitude on swinging without falling?
     
  45. Cuculain

    Cuculain

    Joined:
    Jan 31, 2017
    Posts:
    5
    Hello,
    Trying to figure out Puppet master. I'm using both puppet and falling behaviours. When shooting or pushing a puppet character off a height of some kind it reacts and falls very nicely to the ground below, but then it oddly flies back to its original position before standing up. Thankful for a pointer on how to proceed so it would stand up on the new ground its on.
     
  46. Censureret

    Censureret

    Joined:
    Jan 3, 2017
    Posts:
    361

    Let me show you my setup (the two are on different layers)

    upload_2020-9-30_1-5-51.png

    This is my setup

    The PuppetMaster is on the layer: RagDoll

    And the SpearMan (containing the ootii) is on the layer: CharacterLayer

    The layers are setup like this:

    upload_2020-9-30_1-13-55.png
     
  47. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,521
    Hey,
    To make the puppet recover faster from hit, increase the value of "Regain Pin Speed" in BehaviourPuppet. To increase the range of muscle drift from their animated targets without falling, increase the value of "Knock Out Distance".

    Hey,
    What kind of character controller are you using? Need to make sure that character controller does not force overwrite character position/rotation while the puppet is falling (behaviourPuppet.state != BehaviourPuppet.State.)

    That looks legit.. It is very difficult to guess what might be going on there based on the little information I have. Would it be possible for you to send me that project or a stripped down repro or something? Would probably be the quickest solution.

    Cheers,
    Pärtel
     
  48. sancha-km

    sancha-km

    Joined:
    Jun 5, 2016
    Posts:
    38
    Yes it works, thanks!
     
  49. Cuculain

    Cuculain

    Joined:
    Jan 31, 2017
    Posts:
    5
    Thank you! This seems to have been connected with NavMeshAgent. I'm now using OnLoseBalance and OnRegainBalance to turn navmeshagent on and off and so far is working as expected.
     
  50. Censureret

    Censureret

    Joined:
    Jan 3, 2017
    Posts:
    361
    Hey @Partel-Lang.

    So i actually got it working :)

    However, I could use your help in setting something up.

    I have a spear projectile that is thrown by the main character in my game. The spear is supposed to be magical and be thrown really really hard at the NPC target (puppet) i have a few animations that my characters play but i really want to add the body effect of the puppet being hit really hard.

    However, since this spear is not a huge object the impact effect is rather minor. How can i add such an effect to the puppet. ?