Search Unity

  1. Dismiss Notice
  2. All Pro and Enterprise subscribers: find helpful & inspiring creative, tech, and business know-how in the new Unity Success Hub. Sign in to stay up to date.
    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. Liens

    Liens

    Joined:
    Feb 2, 2012
    Posts:
    49
    Hello, is there any reason why my characters immediately all fall over on game start? It happened after I replaced demo models with custom character models
     
  2. amynox

    amynox

    Joined:
    Oct 23, 2016
    Posts:
    157
    Hi,
    i'm getting this error :
    Code (CSharp):
    1. Joint XXX_ Head secondaryAxis is in the exact same direction as it's axis. Please make sure they are not aligned.
    When i try to modify the joint limit using Ragdoll Editor, there is no "GUI disque" visible (Green, Yellow and blue) when i select "XXX_ Head" ... on other joint the "GUI disque" for changing the joint limit is visible..
    Thanks for your help
     
  3. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,269
    Hey,
    Usually that happens when PuppetMaster fails to initiate because it finds the muscle positions not matching their targets. Usually when people accidentally move a muscle. It should log an error or warning in the Console for you about this when it happens. Stop play mode, right-click on PuppetMaster header and do "Fix Muscle Positions and Rotations"

    It can also happen when you instantiate a puppet in runtime, then move it's Target Root to the spawn location before PM has initiated. In that case, move the root of the entire rig to the spawn location, not just the Target Root.

    For some reason BipedRagdollCreator has failed to figure out some joint axes for that model. So for the head joint, axis is the same as secondaryAxis. Select the head object, change it's "Secondary Axis" to something else, then it will all work again.

    Best,
    Pärtel
     
    amynox likes this.
  4. Liens

    Liens

    Joined:
    Feb 2, 2012
    Posts:
    49
    Thanks, I tried this but it did not make a difference. It doesn't seem to be using the fall state, the puppet stays in standing animation (rigid) and then tips over, once the puppet is fully sideways on the floor, it triggers the 'stand up' state.

    I just found the problem only happens when "Pin Weight" is 0.75, if it's set to 1 it does not fall over on start. Is that intended functionality?

    These are my settings:
     
  5. Futwerk

    Futwerk

    Joined:
    Jun 21, 2020
    Posts:
    6
    Hi @Partel-Lang

    I'm making a VR boxing prototype using Final IK and Puppetmaster, and am trying to get locomotion working on my VRIK avatar. I'm trying to work out whether I'm better off using animation, or trying to modify the solver. In this old article (https://developer.oculus.com/blog/developer-perspectives-character-animation-in-dead-and-buried) you say that the solver is more performant than an 8 way strafe, but in Final IK, you suggest using strafe animation, so I'm a bit confused. I think the solver would work well enough for my purposes, but it makes the character stand square, rather than in a boxing stance, so I would need to modify it if I were to use it.

    My questions are:
    1) which do you suggest (solver edit or animation)?
    2a) if you recommend the solver, which scripts would I have to duplicate and edit?
    2b) if you recommend the animation, have you made any guide or video about how to get this working (I've been having a lot of trouble with it on my own, and haven't been able to find any tutorials)?

    Thanks so much
     
  6. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,269
    Hey,
    Yes, I'd recommend keeping Pin Weight at 1 at all times. You can reduce the pin weights of individual muscles if you expand the Muscles array.

    Hey,
    That blog post is pretty old, I hadn't played around with animated locomotion much back then. If you ever need to move from A to B with thumbstick, I'd go with animated loco. I have this example package for getting started with that.
    Will look better with better animations, in Dead and Buried 2 I used Kubold's animsets, that you can find on the Store.

    Also, to make your character stand sideways, can use "Root Heading Offset" in VRIK Spine settings for that.

    Best,
    Pärtel
     
  7. Liens

    Liens

    Joined:
    Feb 2, 2012
    Posts:
    49
    I will do that from now on.

    I have another issue in the "Melee" demo scene. Every time the character picks up the "Prop Melee" object, the Inertia Tensor increases permanently on "Prop Muscle RArmForarm1". This will increase slightly every time the prop is picked up, and is eventually noticeable as the prop becomes extremely jittery and uncontrollable while held.
     
  8. Mikekan13

    Mikekan13

    Joined:
    May 30, 2015
    Posts:
    77
    I'm trying to use the dynamic anchors in conjunction with a ragdoll on the player. I have a few questions though. Should I just not have a head or hands on the puppet since these are colliding with the dynamic anchors? Or is there a way to rig up those to understand that it is a part of a puppet. Also I don't have Oculus so I couldn't test out the VR Boxer example but I set it up in my own but my question is how do you handle the player's rigidbody (notusing a character controller) from still steam rolling through things with infinite power.
     
  9. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,269
    OMG, you are absolutely right, great find!
    Must be a bug in Rigidbody.ResetInertiaTensor()...
    Anyway, please import this patch to fix the issue. It will now just copy inertia tensor from the prop rigidbody to the propmuscle rigidbody instead of using ResetInertiaTensor().

    Hey,
    I'm not sure you can merge the two methods properly without making things like interactions and holding objects terribly complex and messy. I mean I'd go with either full PuppetMaster or no PuppetMaster and just DynamicAnchors for the player and VRIK for the rest of the body.

    Cheers,
    Pärtel
     
  10. andylewisart

    andylewisart

    Joined:
    Nov 4, 2013
    Posts:
    4
    Hi there,
    I'm trying to develop an app that allows the user to manipulate a patient's arm in VR. I have used Final IK to allow them to grab a hand effector and drag it around, but I'm hoping to develop something more robust. Ideally the user would be able to grab the upper arm of the patient and lift, but could also grab the hand at the same time to keep the hand pinned as the upper arm is lifted, or vice versa. Basically I'd like the patient's arm to behave like a mannequin, and then have it go back to its place when the user lets go of the arm. Also, ideally the user would be able to manipulate the fingers as well. Does anyone have any insights on how to achieve this in either Final IK or PuppetMaster? Thanks for any help!
     
  11. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,269
    Hey,
    It would be easier to do with physics (PuppetMaster) than IK. You'd just have to connect the player's hand to the body part you want to grab with a joint. You'd have to set pin weight to 0 for the patient or at least it's arm muscles, so it would allow you to pull the arm away from it's animation without conflicting the pinning forces. Will work with both hands too.

    Cheers,
    Pärtel
     
    andylewisart likes this.
  12. Liens

    Liens

    Joined:
    Feb 2, 2012
    Posts:
    49
    Thanks, this fixed the Inertia Tensor issue.
    However it looks like that was not the only reason for the jitter. After dropping and picking up props many times (approx. 20x) the prop still has jitter issues. It does not follow the animation correctly, the "Speed" value of the rigidbody is incorrect for each frame of the swing animation (when compared to first time prop pickup).
    If the demo in editor is paused during play and frame-by-frame stepped through (button next to pause button), the prop can more easily be seen jittering wildly around in each frame of the swing animation. You'll find that the prop is out of sync if you compare using this method with a first time pickup swing. It only gets worse with each drop and pickup of the prop.

    I'm not sure what would cause something like that, I thought it was Inertia Tensor but there seems to be something else going on here.
     
  13. advo

    advo

    Joined:
    Apr 6, 2016
    Posts:
    13
    Hi Partel,

    Firstly, such an awesome asset. I bought it recently. I've posted a video on youtube that show what looks to be a very simple problem I have, I hope you can offer some advice of what I might be doing wrong here.

    Link:


    Description of problem:

    Cinemachine FreeLook Camera that follows character transform. When character using PuppetMaster hits obstacle and falls "before" the obstacle he hits, the camera follows the transform "beyond" the obstacle just momentarily before snapping back to the transform of the character which is actually still before" the obstacle. This results in jerky unexpected camera movement. If the character falls "over" the obstacle, there isn't a camera jerk problem.

    The 3 "runs" i did
    0:15 1st run: fall before obstacle
    0:20 2nd run: fall over obstacle
    0:24 3rd run: fall before obstacle

    Hope to hear from you Partel!

    Kevin
     
  14. advo

    advo

    Joined:
    Apr 6, 2016
    Posts:
    13
    HI @Partel-Lang second question - If u have a moving collider, like a speeding car (which is on a layer that has been added to puppet behaviour for collisions), and when the this moving collider hits the character, he loses balance. Thats great.

    But i also want the character to have a knock back effect whilst he is losing balance. Currently the character just loses balance on the spot. What is the best way to achieve this?

    I tried rb.addforce where the rb is the rigidbody is on the puppet ROOT_M gameobject, but it doesn't seem to do anything.
     
  15. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,269
    Hey,
    The Speed value is just rigidbody.velocity.magnitude, so it was different just because the rigidbody behaved differently after a number of pick-ups. I didn't notice at first, but looks like also the center of mass gets 0.1 added to the Z axis on every pick-up. Can't think of any reason other than a PhysX bug, but I made a workaround similar to the inertia tensor, please import a patch from here.

    Hey,
    The camera is apparently following the character controller. While the puppet is being blocked by an object, the controller is in front of it and when it is ragdolled, the controller is moved by BehaviourPuppet to match the ragdoll, so that object is not the best one to follow around with a camera. Try using the pelvis bone of the character as your camera target instead.

    Hey,
    Did you try adding force to the ragdoll rigidbodies instead of that ROOT_M gameobject?
    Might also give you a good effect if you played an animation of walking/running in the direction of the collision impulse at the same time.

    Best,
    Pärtel
     
  16. Avent0620

    Avent0620

    Joined:
    Feb 23, 2020
    Posts:
    1
    HI @Partel-Lang !
    Can I use Puppet Master to create a ragdoll that includes fingers and a tail?
    Please give me some tips for that.
     
  17. GreenRanchGames

    GreenRanchGames

    Joined:
    Dec 18, 2020
    Posts:
    9
    Hi @Partel-Lang ,

    For a game I'm working on, I'm trying to integrate Puppetmaster with Game Creator's default character controller. Everything works great, aside from when the character tries to change CharacterState (crouch, drunk, hurt, meditate, etc). The character always remains in a normal standing pose, and it sometimes sends the camera flying into the air. Do you have any tips on how to successfully combine this Game Creator functionality with Puppetmaster?

    Thanks!
     
  18. brian_cook

    brian_cook

    Joined:
    Sep 14, 2020
    Posts:
    2
    Is there possibly a free demo version of this?
     
  19. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,269
    Hey,
    Yes, but you'll have to add in the extra ragdoll components manually. The easiest would be to do it at ragdoll setup time. Use the BipedRagdollCreator to create a normal ragdoll, then add in the finger/tail Rigidbodies, Joints and Colliders manually before setting up PuppetMaster.
    PM requires ConfigurableJoints, but if you find them confusing, can set it up with other joints, then select the root of the ragdoll and do GameObject/Convert To ConfigurableJoints.

    Hey,
    All I have for GameCreator currently is this example demo setup, just for the basics. Not sure why you are not able to crouch and stuff, I think the problem is probably on the GC side of things by the sound of it, but I can only guess based on that information. I could take a look at your project if you can send something over.

    Hey,
    I don't have a demo version, sorry, but I wouldn't mind refunding you should you find the package unsuitable for your game requirements.

    Cheers,
    Pärtel
     
  20. rechnight

    rechnight

    Joined:
    Nov 21, 2020
    Posts:
    3
    Hi @Partel-Lang ,

    I'm using Puppet Master with UCC, got the raycast shooting working, but ain't being able to damage the character. Is there a script I can use to place on the colliders so can trigger an event when hit by the raycast?

    Thanks!
     
  21. rechnight

    rechnight

    Joined:
    Nov 21, 2020
    Posts:
    3
    OK, kinda got it working. But now I noticed that even when I'm out of ammo, the ragdoll still has impacts from the weapon dry firing. Any help with the script? Thanks
     
  22. GreenRanchGames

    GreenRanchGames

    Joined:
    Dec 18, 2020
    Posts:
    9
    Thank you for the direction to your Game Creator package, I was able to get crouching (etc.) working. Now, like @rechnight above me I am trying to implement raycast shooting with puppetmaster. I'm only having partial success. I have the raycasts set to only impact the ragdoll layer on hit. As you can see in this video, some of the raycasts apply force to the puppet backwards and send him flying in the opposite direction than intended. The raycasts work normally on other plain rigidbody objects.



    The only thing I can think of is there's maybe some weird issue with parenting going on? Hoping to hear your thoughts. Thanks!
     
  23. advo

    advo

    Joined:
    Apr 6, 2016
    Posts:
    13
    Ok thanks Partel will give this a try.

    Thanks @Partel, is there no way to apply force to just one of the ragdoll rigidbodies (to simulate that part of the body that received the direct impact), and all the other joined rigidbodies just "follow" along? I did try your suggestion of applying forces to all ragdoll rigidbodies, it works, but doing it this way theoretically sounds like the whole body got hit with the same force at oncem... instead of the chest being hit and then dragging the arms and legs with it.
     
  24. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,269
    Hey,

    Code (CSharp):
    1. using UnityEngine;
    2. using RootMotion.Dynamics;
    3.  
    4. public class MuscleHitHandler : MonoBehaviour {
    5.  
    6.     public BehaviourPuppet puppet;
    7.  
    8.     private void Start()
    9.     {
    10.         puppet.OnPostMuscleHit += OnMuscleHit;
    11.     }
    12.  
    13.     void OnMuscleHit(MuscleHit muscleHit) {
    14.         Debug.Log(puppet.puppetMaster.muscles[muscleHit.muscleIndex].joint.name);
    15.     }
    16. }
    That script just logs the name of the muscle that was hit to the Console, but it just shows you how to access that kind of information, which object was hit. Can't really give you a script to damage the character as it depends on the rest of your game code/logic that I don't know about.

    Just need to put all the raycasting code into an "if" condition, like:

    Code (CSharp):
    1. if (ammo > 0) {
    2. // raycasting stuff
    3. }
    Hey,
    Could you please share the code you use for raycasting, I'm thinking there's probably something wrong with the force vector calculation.

    Hey,
    Yes, I mean if you find the MuscleCollisionBroadcaster component on the object you hit, can do this:

    Code (CSharp):
    1. var broadcaster = hit.collider.attachedRigidbody.GetComponent<MuscleCollisionBroadcaster>();
    2.  
    3.                     if (broadcaster != null) {
    4. broadcaster.puppetMaster.muscles[broadcaster.muscleIndex].rigidbody.AddForce(...);
    5. }
    Best,
    Pärtel
     
  25. GreenRanchGames

    GreenRanchGames

    Joined:
    Dec 18, 2020
    Posts:
    9
    Thanks Partel,

    I was using the Game Creator shooter module, so I don't think they would be pleased if I posted their source code ;)
    I decided to try my own raycasting which is currently a WIP. I will come back if I need any help.

    On another note, I'm hoping to have my character react to all surfaces in my game world, including the "ground" surface he walks on. After thinking hard about it, I'm not sure that this is possible given the way puppetmaster fundamentally works. Doing this introduces a host of problems such as:
    • Character controller falling through the map
    • Landing too hard from a jump will cause the character to lose balance
    • It's hard to get up from a fall without messing with the Get Up Collision Resistance Multiplier
    Is what I'm trying to do theoretically possible with puppetmaster? And if so, do you have any tips on how to implement it?

    Thank you!
     
  26. arpan018

    arpan018

    Joined:
    Nov 30, 2020
    Posts:
    4
    Hi @Partel-Lang
    i want to achive mechanism where a box type props are attached to two hand. if there is way to faking it would also work. i do have animation of character walking with arm opened in front.
     
  27. Milionario

    Milionario

    Joined:
    Feb 21, 2014
    Posts:
    92
    Should deactivating a puppet(by switching from Active to Deactivated in the puppetMaster dropdown) while it is staggering, then switch it back to Active, cause the whole engine to crash?

    on the stagger demo scene @ unity 2019.3.11f1
     
  28. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,269
    Hey,

    No, using ground like that would cause the puppet stumble with every footstep and unable to get up as the body is continuously in collision with the ground. I normally use a "Small Obstacle" layer for all the small stuff you can stumble into, like rocks or chairs. Ignore character controller collisions with it so the capsule would not prevent the ragdoll hit.

    Hey,
    Attaching the secondary hand with a joint would not be a good idea. I mean there might be situations in the animation where the character is supposed to let go for a moment and then grab again and it would get hugely complicated.
    If you have 2-handed animation for that prop and Final IK, then what you can do is use IK on top of PuppetMaster to fix the secondary hand cosmetically.
    Use puppetMaster.OnRead delegate to store the position and rotation of the secondary hand relative to the primary hand:

    Code (CSharp):
    1. public LimbIK ik; // On the secondary arm
    2. public Transform primaryHand, secondaryHand; // The hand bones (in Animator's hierarchy)
    3.  
    4. private Vector3 secondaryRelPos;
    5. private Quaternion secondaryRelRot = Quaternion.Identity;
    6.  
    7. void Start() {
    8. puppetMaster.OnRead += OnRead;
    9. puppetMaster.OnWrite += OnWrite;
    10. ik.enabled = false;
    11. }
    12.  
    13. private void OnRead() {
    14. secondaryRelPos = primaryHand.InverseTransformPoint(secondaryHand.position);
    15. secondaryRelRot = Quaternion.Inverse(primaryHand.rotation) * secondaryHand.rotation;
    16. }
    17.  
    18. private void OnWrite() {
    19. ik.solver.IKPosition = primaryHand.TransformPoint(secondaryRelPos);
    20. ik.solver.IKRotation = primaryHand.rotation * secondaryRelRot;
    21.  
    22. ik.solver.Update();
    23. }
    There is an example in the Final IK integration package under "Plugins/RootMotion/PuppetMaster/_Integration", where the dummy holds on to a 2-handed gun and aims it accurately even while ragdolled, similar to Max Payne 3.

    Hey,
    If you are looking to recover from stagger without falling, please get this update to BehaviourBipedStagger, just made it last week. Enable “Can Regain Balance” and set “On Regain Balance” event’s “Switch To Behaviour” to “BehaviourPuppet”. Might also be a good idea to add an animation to that event, play some random locomotion like a stop move animation to help mask out the blend to idle.

    Best,
    Pärtel
     
  29. Milionario

    Milionario

    Joined:
    Feb 21, 2014
    Posts:
    92
    Thanks, may i have a list of all the updates and their links like this one?

    Btw I think this has some bugs.

    Most of the times the RegainBalance coroutine is started right after the behaviour starts and not X time after the last step.

    I solved that by setting "lastStepTime = Time.time;" on the behaviour's OnActivate, and got rid of the "timer > regainBalanceTime" on the if statement before the coroutine starts, maybe that should be || and not &&.

    Or there should be two separate fields that represent for example:
    public float timeSinceLastStep(if this time has passed since last step, RegainBalance())
    public float maxStaggerTime or use the old field "duration"(this would only be effective if this time has passed and it didn't recover yet from using the timeSinceLastStep)

    But one thing that really looks odd is that on the regain balance it literally shifts the puppet to the targetroot position, maybe this needs to be fixed with puppetMaster.fixTargetToSampledState and then blend from there...

    btw i am not recovering back to behaviourPuppet, i am using my own behaviours, maybe thats the issue..
     
    Last edited: Jan 8, 2021
  30. Crossway

    Crossway

    Joined:
    May 24, 2016
    Posts:
    442
    After I updated puppet master to v1 when I set state to "Frozen" the character stands in T-pose after falling
     
    Last edited: Jan 12, 2021
  31. nobluff67

    nobluff67

    Joined:
    Nov 3, 2016
    Posts:
    259
    Code (CSharp):
    1.  
    2. refScript.puppetMaster.SwitchToActiveMode();
    3. Debug.Log("is Puppet Active yet? " + refScript.puppetMaster.isActive + " ref " + refScript);
    4.  
    It seems that puppetmaster is not set to active immediately (debug is false on above code).

    Is this correct or am I doing something wrong?
    Is this a case of "it takes a few frames" in order to complete?

    A temporary solution for me is to launch a Coroutine with a loop that checks until the puppet is active, and then performs the code I need. I don't think this is a safe solution but I dont know what else to do.
     
    Last edited: Jan 11, 2021
  32. nobluff67

    nobluff67

    Joined:
    Nov 3, 2016
    Posts:
    259
    As per Partel,

     
  33. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,269
    Hey, sorry, missed a notification here, too many different support channels...

    Yes, you are right, thank you for the feedback. I made some changes. So I added in that lastStepTime to OnActivate like you suggested, also added one more parameter. Changed coroutine starting conditions to this:

    Code (CSharp):
    1. // Can we initiate re-gaining balance?
    2.         private bool CanRebalance()
    3.         {
    4.             if (canRegainBalance) return false; // Not allowed to
    5.             if (isRegainingBalance) return false; // Already re-gaining balance
    6.             if (balanceLost) return false; // Already fell over
    7.             if (angle > regainBalanceAngle) return false; // Too high COM angle, not standing straight
    8.             if (timer < regainBalanceMinTime) return false; // Not enough time has passed since behaviour activation
    9.             if (Time.time < lastStepTime + regainBalanceMinTimeSinceLastStep) return false; // Not enough time has passed since last footstep
    10.            
    11.             return true; // All good
    12.         }
    Hey,
    Strange, can't see that happening here. Maybe you have some Final IK on that character and "Fix Transforms" enabled in that IK component?

    Cheers,
    Pärtel
     
  34. GreenRanchGames

    GreenRanchGames

    Joined:
    Dec 18, 2020
    Posts:
    9
    Hi @Partel-Lang,

    I'm using puppetmaster in a multiplayer game with PUN2. Each player controls a puppet. I'm trying to sync the ragdolls on fall using your PUNPuppet script from the PUN demo. The actual syncing while unpinned works well, but I'm encountering a problem when they try to get up. Getting up works normally on the puppet owner's session, but occasionally the puppet will fall when getting up on other clients and stays on the ground mapping to the running animation once the owner starts running around again. Do you have any suggestions on how to fix this issue? Is there maybe a way I can continue to sync the rigidbodies until the puppet is done getting up?

    Thank you!
     
  35. Milionario

    Milionario

    Joined:
    Feb 21, 2014
    Posts:
    92
    Thanks for the fix partel, I am gonna take a look. Do you mind sharing where I can also have a look of all these non official fixes/updates? I mean these that you send on dropbox that are not yet on the asset store?
     
  36. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,269
    Hey,
    Did you use PUNPuppet or did you make a custom version of that script?
    The trick is to set behaviourPuppet's knockOutDistance to Mathf.Infinity for the remote clients, so they don't lose balance while getting up or at any other time either unless they get a call to do so from the owner. See how the PUNPuppet rpc's orders to lose balance and get up to the remote instances.

    Hey,
    Never had a list, but yeah, I guess I should.

    Best,
    Pärtel
     
  37. sancha-km

    sancha-km

    Joined:
    Jun 5, 2016
    Posts:
    36
    Puppet_with_rigibody.gif
    Hi,
    Sometimes rigibody objects go through the puppet and remain in it. Puppet can't get up.
    Rigidbody objects is set to continious dynamic, all rigidbodies on puppet always switch back to Discrete.
     
    Last edited: Jan 22, 2021
  38. Crossway

    Crossway

    Joined:
    May 24, 2016
    Posts:
    442
    Yes disabling Fix Transforms on Full Body Bipedal IK solved this issue but that was enabled by default! Should I keep that disabled?
     
    Last edited: Jan 22, 2021
  39. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,269
    Hey,
    Changing Default Contact Offset in the Physics settings might help. Or maybe reducing collider materials have too much friction.

    Hey,
    Yeah, keep it disabled if you always have animation playing on the character. It is enabled by default just to prevent bugs for people that don't use animation or are using IK on some bones that have no keys in the animation.

    Best,
    Pärtel
     
  40. jason416

    jason416

    Joined:
    Nov 8, 2018
    Posts:
    29

    Sorry if this is an obvious question but how does one create a Humanoid config file from an existing puppet? I've searched the docs and can't seem to find any reference to this? I'm on 2018.4LTS and PM V1.0
     
  41. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,269
    Hey,
    Not obvious at all, I don't know why it wasn't even possible :). Please grab this update to PuppetMasterHumanoidConfig, then you'll be able to just right-click on PuppetMaster header and do "Save Settings as Humanoid Config" from the context menu.

    Best,
    Pärtel
     
    jason416 likes this.
  42. jason416

    jason416

    Joined:
    Nov 8, 2018
    Posts:
    29
    Thanks Pärtel, This works great.
    But if I have added prop muscles I get this error: IndexOutOfRangeException: humanBoneId must be between 0 and LastBone. Can you accommodate extra prop bones?
     
  43. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,269
    Oh, sorry, that one should work with prop muscles too.

    Best,
    Pärtel
     
  44. eran-kleiner-simbi

    eran-kleiner-simbi

    Joined:
    Nov 15, 2020
    Posts:
    1
    Hi Pärtel!

    I'm currently developing a VR application where there's a tracker attached to a (real) puppet's head, and I want to drag it around the space such that the ragdoll's head in Unity will follow the tracker. How would you recommend doing it? I tried relying on your "Hanging" demo but couldn't get it to work (creating an empty object, placing it near the head, adding a configurable joint with limited motion, attaching it to the head's rigidbody, and lowering the pin weights to 0). The ragdoll is bouncing like crazy...
    ezgif-6-663096f814cc.gif
     
  45. alsomitra

    alsomitra

    Joined:
    Aug 31, 2017
    Posts:
    26
    Hey @Partel-Lang

    I would like to make "BehaviourPuppet and BehaviourBipedStagger" fall in a specific direction.

    Unfortunately, if I only use "behaviourPuppet.SetState(BehaviourPuppet.State.Unpinned)", it won't fall in a certain direction. He just loses his balance on the spot and falls down.

    Please tell me how to make him fall in a specific direction without hitting him with the ball.

    Also.

    BehaviourBipedStagger's puppet can't get up and disappears.
    Is it possible to get him to stand up in the position he is falling?

    Thank you.
     
    Last edited: Feb 2, 2021
  46. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,269
    Hey,
    You should do that kind of stuff with IK, not joints. Basically use IK to change the pose that the puppet is trying to follow.
    Do you have Final IK? If you do, import the Final IK integration package from Plugins/RootMotion/PuppetMaster/_Integration and check out the "Ragdoll Aiming" demo. It aims a gun while ragdolled, something like Max Payne 3, but it could be just as well be aiming the head (looking at stuff).

    Hey,
    After you call SetState, also add some force to the chest rigidbody in the direction you need him to fall in.

    About the other question, did you mean the puppet in the stagger demo? There are 2 puppets there, the one that only has stagger behaviour, teleports to where it started from, but the other one also has BehaviourPuppet so that one will switch to BP and get up from where he is.

    Best,
    Pärtel
     
  47. LaCorbiere

    LaCorbiere

    Joined:
    Nov 11, 2018
    Posts:
    29
    Hello. I am 3d modelling, rigging and animating my characters from scratch for a game in Unity that I want to add Puppet Master to. Is there any guide on good practice advice for this? I've looked on YouTube and almost everything is set up with pre-existing rigs and animations. I've tried with a pre-existing rig I did while ago but don't look pretty! Also, has anyone got Puppet Master to work OK with Emerald AI? Many thanks!
     
  48. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,269
    Hey,
    When rigging keep in mind those good practices:
    1. make sure the character faces the positive Z axis of it's root
    2. root should be at ground level, not hip level
    3. bones should be oriented so that one main axis is pointing towards the next bone (because colliders can't be rotated in Unity)
    4. foot bones should be aligned with the ground (also because colliders can't be rotated in Unity). There's a workaround to add a child gameobject to the foot rigidbodies, move the collider over to that and rotate that object, but it will be less work if the bones were already rotated right.
    5. better not use perfect T-pose, have the elbows/knees slightly bent in their natural bending directions. That makes it possible for BipedRagdollCreator to calculate joint limits for them.
    6. if you have roll bones for the forearms, have them parented to the forearm bones.

    About Emerald AI, haven't tried it myself (sooo many different third party AI packages out there), but I've heard of people using that together with PM.

    Best,
    Pärtel
     
    LaCorbiere likes this.
  49. LaCorbiere

    LaCorbiere

    Joined:
    Nov 11, 2018
    Posts:
    29
    Thank you Pärtel. Great info. So all that in mind, when I get the character into Unity, is it just a case of following this process? http://root-motion.com/puppetmasterdox/html/page4.html

    I think I am not sure about the prep / scripts you need to add before adding Puppet Master. Thank you.
     
  50. andthenwhat

    andthenwhat

    Joined:
    May 11, 2015
    Posts:
    3
    I am trying to figure out how to connect two puppets by the hand (in the PM Hanging demo, the character's hand is connected to a configurable joint, but I can't sort how to connect character1's left hand to e.g. a character2's right hand and have character2 hand from character1 (who is hanging from the configurable joint).

    I've got PM and FinalIK (and searched the forum, but may not have used the right magic words), any help much appreciated!
     
unityunity