Search Unity

  1. Get all the Unite Berlin 2018 news on the blog.
    Dismiss Notice
  2. Unity 2018.2 has arrived! Read about it here.
    Dismiss Notice
  3. We're looking for your feedback on the platforms you use and how you use them. Let us know!
    Dismiss Notice
  4. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Learn more.
    Dismiss Notice
  6. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  7. 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
  8. 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,677
    Hey,
    Nice job mate, thanks for sharing the demo!

    Hey,
    Yeah, I have GenericRagdollCreator in my todo list, but not sure when it will be done, got tons of other stuff there too.

    It would be best to create everything via code, if you are interested in maximum freedom of model replacement. It's not just a good idea with PuppetMaster, its a good idea with everything else too. Please take a look at the "Create Ragdolls In Runtime" and "Create Puppets In Runtime" demos to get started. BehaviourPuppet and BehaviourFall you can just instantiate from a prefab and parent to the "Behaviours" gameobject. PuppetMaster also has the "Humanoid Config" option that allow you to use a single PuppetMaster settings configuration file for multiple characters. See the "Humanoid Config" demo about that.

    Hey,
    That's in my todo list to take a look at, can't give you an estimation at this time though, not sure about all the technical limitations to that yet. Could you tell me more about the flying off glitches you are seeing?

    Best,
    Pärtel
     
  2. Useless-Media

    Useless-Media

    Joined:
    Apr 19, 2015
    Posts:
    104
    Hey,

    I have take a look at the AimIK demo you made with puppet master and final ik.
    Its working perfect in your demo but after i made it exactly the same like you did with my puppet then i have some strange results.

    I found out there is something wrong with my setup with this code
    Code (csharp):
    1.  
    2. void OnPuppetMasterRead()
    3.         {
    4.             if ( m_AmingStart )
    5.             {
    6.                 // This enables for using recoil, reload and gesture animations without weighing out AimIK.
    7.                 m_AimIK.solver.axis = m_AimIK.solver.transform.InverseTransformVector( m_Animator.transform.rotation * AnimatedAimingDirectionOffset );
    8.             }
    9.         }
    10.  
    I have the AimIK component on the same GameObject like the Animator.

    It looks like the aim gets multiplied and is increasing by angle.
    AimToMuch.gif
    I just Aim a little up and the character overdo the Aim.

    When i comment the code out everything work except the character does not Aim exactly to to the Target which depends on the AimIK Axis which i want modifier to Aim exactly to the target

    The question is how do i match the axis exactly to the Target?

    I think i just did it.

    Code (csharp):
    1.  
    2. // GET THE PROP
    3.                 var prop = m_PuppetMaster.muscles.ToList().Find( x => x.props.group == Muscle.Group.Prop );
    4.  
    5.                 //// This enables for using recoil, reload and gesture animations without weighing out AimIK.
    6.                 m_AimIK.solver.axis = m_AimIK.solver.transform.InverseTransformVector( prop.target.rotation * AnimatedAimingDirectionOffset );
    I just need to get the weapon itself, so simple





    EDIT: Yes its working but i still need to offset the axis.

    How can i change the Axis in this way that he automatically find the value to the Target?
    I have calculated the wanted Rotation from the Prop to the Target, so basically i need to convert the those Rotation to a Axis Rotation.
    I already try out Quaternion.ToAngleAxis but maybe wrong.

    Please guide me, i have the Rotation of the Prop, the Wanted Rotation and i think with this 2 things the relative rotation axis is possible.
     
    Last edited: May 19, 2018
  3. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,677
    Hey,
    Not entirely sure I understand what you are trying to do, but if you have calculated the offset you need for accuracy, you can apply it once to the AnimatedAimingDirectionOffset like so:
    Code (CSharp):
    1. AnimatedAimingDirectionOffset = calculatedRotation * AnimatedAimingDirectionOffset;
     
    Useless-Media likes this.
  4. somosky

    somosky

    Joined:
    Feb 15, 2014
    Posts:
    91
    Hi I am having a few issues adding Puppet Master to a multiplayer game.

    It's a first person shooter game so I've added in functionality to my raycastfire script to check for the correct PuppetMaster components and it works fine with in a single player situation. The issue is when I build the game. This works fine on the Host Computer but when the clients shoot a PuppetMaster object I get a NullReferenceError for this line of code

    var broadcaster = obj.GetComponent<Collider>().attachedRigidbody.GetComponent<MuscleCollisionBroadcaster>();

    Below I've attached the part of the script that has to deal with this Function not working. Also I've noticed that the Puppet detaches from the Root gameobject upon the scene starting. Does the detached Puppet Master gameobject need to have a network identity on it to work properly. I've tried to add a network identity to it and it didn't fix my issue but it also didn't seem to have any negative effects. Thanks alot.

    void firebullet()
    {
    Vector3 fwrd = FPCamera.transform.forward;
    Vector3 camUp = FPCamera.transform.up;
    Vector3 camRight = FPCamera.transform.right;

    Vector3 wantedvector = fwrd;
    wantedvector += Random.Range( -inaccuracy, inaccuracy ) * camUp + Random.Range( -inaccuracy, inaccuracy ) * camRight;
    Ray ray = new Ray (FPCamera.transform.position, wantedvector);
    RaycastHit hit = new RaycastHit();

    if (Physics.Raycast(ray,out hit, range,mask))
    {
    Vector3 HitPoint = hit.point;
    GameObject decal;
    GameObject line;
    line = Instantiate (lineprefab, transform.position, transform.rotation) as GameObject;
    LineRenderer linerender = line.GetComponent<LineRenderer> ();
    linerender.SetPosition (0, currentmuzzle.transform.position);
    linerender.SetPosition (1, hit.point);
    }
    if (hit.transform.tag == "water")
    {
    Debug.Log("Hit PuppetMaster Object");
    CmdPuppetMasterDealDamage(hit.transform.gameObject, HitPoint, fwrd, ray);
    }

    [Command]
    void CmdPuppetMasterDealDamage(GameObject obj, Vector3 HitPoint, Vector3 fwrd, Ray ray)
    {
    GameObject HitEffect = Instantiate(impactnormal[CurrentHitEffectInt], HitPoint, transform.rotation);
    NetworkServer.Spawn(HitEffect);
    var broadcaster = obj.GetComponent<Collider>().attachedRigidbody.GetComponent<MuscleCollisionBroadcaster>();
    if (broadcaster != null)
    {
    broadcaster.Hit(unpin, ray.direction * force, HitPoint);
    }
    else
    {
    Debug.Log("None Found");
    }
    }
     
  5. Ohhhglasses

    Ohhhglasses

    Joined:
    Jan 15, 2015
    Posts:
    2
    I'm wondering if there are some suggested practices for a problem I'm having with Puppet Master. I acknowledge that I may be doing something wrong. My question is around collision events.

    I have my main bone heirarchy which is animated (and also contains all game components such as hp for instance, which is stored on each body part in this game.)
    I've created my puppet master heirarchy using the ragdoll creator and everything is working just fine. However, I don't want to create even more colliders and rigidbodies on my main bone heirarchy for performance reasons. Is there a suggested approach so that I can use the puppet master heirarchy's colliders alone and detect collisions and maybe pass them over to the main bone heirarchy somehow? Right now, I intend to create a mapping between the puppet master's bones so that I can send the events on over. I just wonder if there is a standard approach to this problem, potentially a more lightweight approach?
     
  6. Useless-Media

    Useless-Media

    Joined:
    Apr 19, 2015
    Posts:
    104
    I using the Collision Events on BehaviourPuppet:

    Code (csharp):
    1.  
    2. private void Start()
    3.         {
    4.             var puppet = this.GetComponentInChildren<BehaviourPuppet>();
    5.  
    6.             puppet.OnPreMuscleCollision += OnMuscleCollision;
    7.             puppet.OnPreMuscleCollisionExit += OnMuscleCollisionExit;
    8.  
    9.             //puppet.OnMuscleHit +=
    10.             //puppet.OnCollisionImpulse +=
    11.         }
    12.  
    13. public void OnMuscleCollision( MuscleCollision m ) {
    14.  
    15.         }
    16. public void OnMuscleCollisionExit( MuscleCollision m ) {
    17.  
    18.         }
    19.  
    Just Create a List of your collision class/struct and add and remove the items in the list in this 2 events
     
    Partel-Lang likes this.
  7. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,677
    Hey,
    If you get a NullReferenceExeption on this line, it's either that the object that hits doesn't have a collider on it (maybe it's on it's child?) or there's no Rigidbody on it.

    The networked PuppetMaster is supposed to detach, that is because it only needs to be moved by physical forces, not by you moving the character controller. As the root needs to have the NeworkView, normal PuppetMaster hierarchy can't work, so it detaches.

    Hey,
    As Useless-Media already kindly suggested.

    Cheers,
    Pärtel
     
  8. somosky

    somosky

    Joined:
    Feb 15, 2014
    Posts:
    91

    So after doing some testing last night the issue I am having is that I raycast and hit the body part of the Puppet. I've debug.logged the name of the body part to make sure that's working. That Puppet as you mentioned is unparented from the game object. So it no longer has a Network ID so through my Cmd function I can't alter it .

    I wrote a new function that passes a reference to the rag doll and the character as well as a string that names which body part was hit. That is almost working but what happens is shot from the client the Puppet slightly moves and if you shoot from the server the Puppet gets the correct amount of force added to it and acts correctly. It's almost as the force gets added by the client but the servers puppet moves it back immediately negating the force added.

    All of your demo scenes are great and have been a great help but since the networking one is using a object to simulate force instead of a raycast I'm really struggling with this part.
     
  9. keifyb

    keifyb

    Joined:
    Feb 12, 2016
    Posts:
    61
    im trying follow the tpc integration tutorial to use with the unet demo with no joy. The guy keeps flying off to the sky if i touch a damage object. any updates on this?
    ive also tried it with unitz unet but no joy there also. im really struggling to understand how to use it in a multiplayer environment.
     
  10. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,677
    Hey,
    You can access the Network ID by getting the MuscleCollisionBroadcaster component of the shot muscle, from which you get access to PuppetMaster and puppetMaster.targetRoot is the gameobject that has the NetworkView.

    About the reaction to hits being different, are you using MuscleCollisionBroadcaster.Hit on both the server and the client to shoot them? Or some other way?

    Hey,

    Does it fly off to the sky only in the multiplayer setup you have or also in single player mode? Maybe the character controller layer is set to collide with the ragdoll layer? That is the most common reason for puppets flying off to the sky.

    Under Plugins/RootMotion/PuppetMaster/_Integration there is an UNet example. The idea in short is that BehaviourPuppet on the server is in control and calls SetState on all others. So if the server loses balance, it calls an RPC on others that call behaviourPuppet.SetState(BehaviourPuppet.State.Unpinned). Getting up is handled the same way. Se knockOutDistance to Mathf.Infinity and disable canGetUp on the non-server BehaviourPuppets.
     
  11. kpgbrink

    kpgbrink

    Joined:
    May 1, 2017
    Posts:
    1
    I bought both final Ik and puppet master and so far I love it although I still am not good at using it and have a lot to learn

    I was wondering how to make an object able to only hit the ragdoll from the side and the top of the character but hit the character controller if hitting the person on the bottom so it can be walked on. I know you could make it hit both but I don't think it would look as good.
    I'm trying to make a game with moving objects that can knock you down but you can also walk/run if you're on top of the object. If anyone has an idea on how to do that best that would be great.
     
  12. PeterBrown

    PeterBrown

    Joined:
    Sep 11, 2013
    Posts:
    72
    Hey Partel!

    is it somehow possible to "unpin" only a few muscles? like the arms BUT keep the normal mode to unmapped instead of active? when i set the mode to Active, then set the arms mapping and pin weight to 0 then its no problem but then it totally messes my IK stuff (using unitys built in IK, not final IK)

    so iam more or less looking for a way to keep the body Unmapped, except the arms
     
  13. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,677
    Hey,

    Maybe change the object's layer by script depending on where it is relative to the player.
    Or separate it to 2 colliders, the main one being able to hit the ragdoll and a thin one on top of it that you could walk on.

    Hey,
    Sorry, what were you using the IK on, the arms? If they're unpinned, the IK will not be very accurate anyway. Anyway, you could do it with a script like this:
    Code (CSharp):
    1. public PuppetMaster puppetMaster;
    2.  
    3.     void Start () {
    4.         puppetMaster.SetMuscleWeightsRecursive(HumanBodyBones.LeftUpperArm, 0f, 0f);
    5.         puppetMaster.SetMuscleWeightsRecursive(HumanBodyBones.RightUpperArm, 0f, 0f);
    6.     }
    7.    
    8.     void Update () {
    9.         foreach (Muscle m in puppetMaster.muscles) {
    10.             if (m.props.group == Muscle.Group.Arm || m.props.group == Muscle.Group.Hand) {
    11.                 m.state.mappingWeightMlp = 1f;
    12.             }
    13.         }
    14.     }
    That basically forces the arms to be mapped even in Unmapped mode.
     
  14. PeterBrown

    PeterBrown

    Joined:
    Sep 11, 2013
    Posts:
    72
    oh, thanks, sorry for the weird formulation of the question, also just red it again and thought "what?"- been a long day :)
    anyway, that was exactly what i was looking for, thank you very much!

    btw, if someone stumble over this too: you also have to set the mapping blend speed to 0 or 1 :) on default its 15
     
    Last edited: May 31, 2018
  15. megan_l_fox

    megan_l_fox

    Joined:
    Jul 10, 2010
    Posts:
    28
    (sorry if this was already asked)

    I have a situation where I need to make the ragdoll go into Kinematic mode for a while, animate it along a line, then it pops out the other end - and needs to go to Active mode again. I need the ragdoll kinematic during that animation because there's a hard-pop to the start of the line, which the ragdoll interprets as an instant / infinite velocity movement, and it just pops off like a rocket if it isn't kinematic at the time.

    This works for running up to the kinematic phase, and through the kinematic phase, but the second I flick the ragdoll back to Active mode, it dies / unpins. I've got a force/collision-type behavior on it that knocks it down if anything hits it too hard, and it dies normally. It just looks like it falls off the second it goes Active,

    It looks a bit like when I flick the ragdoll to Active, it's inheriting the effective velocity it had as I lerped it along the line in kinematic mode. Or maybe it's re-enabling the muscles back at the start of where the lerp began, and sort of shooting off like a rubber-band? Hard to tell. The ragdoll doesn't explode off, it just falls/dies with, visually, about the speed you'd expect if it had died right at the moment the lerp ended.


    The object it's parented to (which also got flicked to kinetic as it lerp'ed along the line) also gets flicked back to non-kinematic, and given the effective velocity it had during the lerp, which is about the velocity it had before the lerp began, SO, if I could get it all to reset properly, it should be fine... but I'm not sure how to update/reset whatever internal tracking the ragdoll is doing, to get it there.


    EDIT: OH! No, I see. What's happening is it actually falls off at the START of the lerp. Probably because when setting Kinematic mode, there's blend, and before that blend completes, the aforementioned insta-snap movement happens, which snaps it off, but then it finishes going to kinematic, and it just seems like it's ok until the far end.

    So I just need to enable kinematic mode instantly before the lerp, with no blend / no delay, and the rest would seem to be fine.

    EDIT2: Hah, got it! Will leave this for anyone else needing the same thing.

    So the trick is, you send the blend time to 0.0 before entering kinematic mode. That pops you instantly in - you can now jerk your character around, hard-pop position to across the map, whatever you want. Set the blend time back to 0.1 when you leave kinematic mode, since that's the safe end, and it'll all feel nice and proper and smooth.
     
    Last edited: Jun 12, 2018
    hopeful likes this.
  16. Useless-Media

    Useless-Media

    Joined:
    Apr 19, 2015
    Posts:
    104
    Just a little idea im playing with.

    I using Props as 3D UI, probably someone like this idea and want use it in his game.
    It looks like this:

    2018-06-18 23_51_46-.png

    Have a nice day.
     
  17. Necka_

    Necka_

    Joined:
    Jan 22, 2018
    Posts:
    154
    Hello,

    I've just started using PupperMaster (I got Final IK too but I'll get to it later)

    While reading the Behaviors part of the doc I noticed you wrote that more behaviors (at least 2) were planned after release. Which is now a while ago I guess

    Are you still planning on releasing some behaviors for PupperMaster? Or are there some community ones somewhere around here?

    thank you, the assets looks great so far
     
  18. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,677
    Hey,
    There is BehaviourBipedStagger, that handles balancing and taking a couple of stumbling steps in full ragdoll mode, but that requires also having Final IK. It's in the Final IK integration package under Plugins/RootMotion/PuppetMaster/_Integration. There has not been almost any use for this kind of stuff though, so I've been focusin on improving the features that are already there. If you have a specific feature idea or request, I'd be happy to hear it.

    Cheers,
    Pärtel
     
  19. Necka_

    Necka_

    Joined:
    Jan 22, 2018
    Posts:
    154
    Hi,

    oh ok, I'm surprised that it's not a used feature, sounded to me like it was the major highlight of this asset.

    I've read in the documentation that you had two, and one sounded interesting (Fall catching or something like this)

    My main focus for this asset is to have Puppet Master to handle the damages from weapon (swords and all) and react accordingly from where the damage comes and how strong they are.

    Like a sword slash on the right side of the body would disorient a bit the character, but the most powerful sword skill slash would actually make the character fly in the air a bit and fall because of how strong it is. I don't know if this is possible with what the asset got "out of the box" though
     
  20. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,677
    Hey,
    It would probably be easiest to achieve if you combined PuppetMaster with hit reaction animations. So the puppets still solve the contacts physically, but starting a hit reaction animation at the same time would significantly add to the realism.
     
  21. Necka_

    Necka_

    Joined:
    Jan 22, 2018
    Posts:
    154
    Got it, I have something in place (before I implemented Puppet Master) that does a hit reaction animation depending on the power of the attack, I'll play around with it and Pupper Master and see how it goes then
     
  22. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    933
    What does it mean?
     
  23. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,677
    Hey,
    It means the target of the pelvis muscle has gone missing for some reason (maybe you destroyed it?). If you expand the Muscles array on the bottom of PuppetMaster and expand the first muscle, you should see that it's "Target" slot is empty when you see that error.
     
  24. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    933
    But it looks correct! Still I get the error.
     

    Attached Files:

  25. Useless-Media

    Useless-Media

    Joined:
    Apr 19, 2015
    Posts:
    104
    Hi Partel

    I have subjective problem with my character.

    I like the Physics but i just run in problems on the Weapon aim accuracy setup.

    PuppetMaster works fine, it does what it do and perfectly animates physics but for the aim i don't want the weapon swinging around so much.
    Im also using AimIK from Final IK and i was playing around with the Aim Axis and also try to calculate the Aim Target relative to the gun to force the weapon to focus the aim.
    I only have this problem when the character moves and it looks like this.
    shakyAim.gif

    All what i want to do is Lerping back to the middle point when the weapon breaks out.
    Thank you for the reply.
     
  26. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,677
    Hey,
    Did you take that screenshot right after the error occured? Because that error is logged when muscle.target == null so I can't think of how the target slot could still be filled. Sorry, have not seen this bug before. Does it happen just once when the game starts or some time later?

    Hey,
    Have you tried setting BehaviourPuppet's "Normal Mode" to "Unmapped"? That would keep mapping weighed out until there is a collision and then weigh it out again.

    Best,
    Pärtel
     
  27. Useless-Media

    Useless-Media

    Joined:
    Apr 19, 2015
    Posts:
    104
    Hey, you are right it was on "Active" and when i change it to "Unmapped" it indeed works better and would work in the most cases.
    My Character setup is a little different, i decided to make no ground layer, only a collision layer and the character also walk on this collision layer, for me does this make more sense when it comes to level design later on.

    I think this is the reason why i have this result:
    The character aim correctly but when the foot hits the ground which is a collision layer than the weapon breaks out because of the physics reaction.
    shakyAim2.gif

    So its better to change the Aim IK in some ways to balance this glitch out right?

    EDIT: I try out to set the ground layer and i saw no big difference between having the collision layer as ground or having the whole map as ground.
    So it must have a other reason why the gun breaks out, when i jump then its totally stable so maybe its just the physics.

    I want change the Aim Target of the AimIK in some ways that when the characters weapon goes down for some reason i set the Aim Target more up by finding the distance of the weapon aim position and the wanted aim to offset the aim target
     
    Last edited: Jun 28, 2018
  28. unity_909ituber

    unity_909ituber

    Joined:
    Feb 18, 2018
    Posts:
    1
    Hello Partel,
    Is there script to unpin the puppet behaviour?
     
  29. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,677
    Hey,
    Having the ground layer included in Collision Layers is not good at all for many reasons. One is what you are seeing, the Unmapped mode not working right because the feet are always in collision. The other is the foot-ground contacts are always keeping your puppet in a half-pinned state, which makes the animation following less accurate in Active mode also. The third is that your puppets may fail to get up properly as they are in full body collision with the ground and it keeps unpinning it so you'll have to set collision resistance values very high.

    You could fix it with AimIK, but just cosmetically (won't affect the physics), if you solve AimIK once more, but after PuppetMaster has mapped. See the "IK After Physics" demo in the Final IK integration package. But I wouldn't really recommend that approach, better to set the layers right.

    About changing the aim target when the weapon goes down or something, there is a solution for that, you can set AimIK to work in "additive mode" with a line of script, so that enables you to use all kinds of weapon animations like recoil, reload. The easiest would be to implement the new AimController component (see the "Aim Controller" demo in the latest FIK), it also takes care of many other things like smooth weight and target blending. You could also do it with a couple of lines of code like this:

    Code (CSharp):
    1. public AimIK ik;
    2.         [Tooltip("The direction of the animated weapon aiming in character space. Tweak this value to adjust the aiming.")] public Vector3 animatedAimDirection = Vector3.forward;
    3.  
    4.         void LateUpdate () {
    5.             ik.solver.axis = ik.solver.transform.InverseTransformVector(ik.transform.rotation * animatedAimDirection);
    6.         }
    Hey,
    Code (CSharp):
    1. behaviourPuppet.SetState(BehaviourPuppet.State.Unpinned);
    Cheers,
    Pärtel
     
  30. Useless-Media

    Useless-Media

    Joined:
    Apr 19, 2015
    Posts:
    104
    Hey,
    I followed all steps and it was a great help.
    One thing that i realize was just the wrong animations, the side walk and side run animations have a to shaky upper body.
    shakyAimOnAnimation.gif
    As you can see the forward walk does his aim job really well.
    I think i change the animations and this finally solve this problem.

    One thing i want suggest is that it would be nice when you can assign the ground and collision layer ( mostly the ground layer ) on the BehaviourPuppet Muscle Group Overrides individually.
    This have the purpose to set a ground layer just for the feet because a most humanoid characters walk just normal with the foot on ground, so it does make sense to just let the foot recognize the ground.
    The other thing is when there is a Mesh with a shape which let you walk on it and also can collide with the head at the same time ( Something like a half sphere shape ) then i really don't know which layer i pick because its there to activate the Character physics and also its walkable so when i just have the feet manage the ground and the other body parts are managing the collisions i also can handle maps which are made of one single object

    Well its still one of my favorite asset, have a great weekend.
     
  31. Deejayfistfang

    Deejayfistfang

    Joined:
    Dec 4, 2017
    Posts:
    8
    Hey everyone (and Mr. Partel Lang). I've fully integrated, and modified to a great extents, many Final IK and Puppetmaster features into my game Sandbox Showdown from Steam. Check out a this clip for fun.



    Puppetmaster and FinalIK are great products with quite a bit of flexibility, I'd recommend them.
     
    Last edited: Jul 2, 2018
    Useless-Media likes this.
  32. Necka_

    Necka_

    Joined:
    Jan 22, 2018
    Posts:
    154
    Hello Partel,

    I would like to know the best practice regarding PuppetMaster + Ootii's Motion Controller

    I didn't find a documentation or tutorial on how to integrate them (If I missed it, I'm sorry to bother)

    I found the Opsive one and tried to follow up and just added the Ootii Puppet Master bridge on my character, where Actor and Motion controller are.

    I got weird results so far, I'll try to tune things but for example when I do a normal melee attack now the character spin on itself.

    My main question as I don't want to use Puppet Master for each collision but just in combat, it's about Rigidbody explosion.

    I know how to manage it on a regular cube with RigidBody add explosion force.But it doesn't work with my NPC who has Motion controller and Puppet Master. I believe the motion controller is blocking any movement.

    At the moment I have a kinematic rigidbody on my character and all the regular Ragdoll rigidbody on the bones.

    Would you say I don't need anymore the character's rigidbody and apply the explosion force only to the Ragdoll? I believe an explosion force is anyway not detected as a collision, so the "automatic unpin" is going to be missing

    Sorry if those question sound stupid.

    Also the demo scene of Ootii integration is missing Prefabs (even after a clean import) so nothing is working there
     
  33. PeterBrown

    PeterBrown

    Joined:
    Sep 11, 2013
    Posts:
    72
    Hey!
    Quick question, how can i add a new muscle to the "individual muscle settings" at runtime/via code? so that i can add a new bone when my creature evolves. how to add the new joints and targets to the right fields is easy but i somehow cant figure out how to set for example the muscle count (size) from 29 to 30
     
  34. matteumayo

    matteumayo

    Joined:
    Jul 25, 2016
    Posts:
    161
    Hello,

    I have a quick question regarding props. I've been struggling with rare instability in my current puppet setups with props involved. I recall you mentioning that eliminating a muscle in the chain can help with joint chain stability.

    Is it possible to "add" the prop (minus the usual joint) to the existing hand muscle rather than setting up the additional prop muscle as usual? If so, would you mind giving a brief run-down on how this is done? I ask because I see a couple ways it might be done, and figured you'd know what's best.

    Thank you.
     
  35. Useless-Media

    Useless-Media

    Joined:
    Apr 19, 2015
    Posts:
    104
    Hey,

    I have some nasty small spikes in my Puppet.


    I don't know where i get this, it looks like its a update thing, when i lower the FPS that this spikes come more than on higher frames.

    I update Final IK with the PuppetMaster OnRead delegate but probably ( also when i update Final IK normal ) i have still the same result.

    Im sure it have something to do with PuppetMaster.
    BehaviourPuppet is on Active mode.

    Cheers.
     
    Last edited: Jul 3, 2018
  36. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,677
    Hey,
    That is not a bad idea actually, I'll add it to my todo list, thanks!

    Hey, that looks really cool! :D Thanks for sharing the video and good luck with the game!

    Hey,
    Looks like Ootii has updated their asset and broken the integration. Here's the updated integration package.
    Please follow the steps in the comments of the "_README!" gameobject in the "Ootii Puppet Terrain" scene to set up your own character.

    To explode your character, call behaviourPuppet.SetState(BehaviourPuppet.State.Unpinned) and then AddExplosionForce on all the rigidbodies.

    Hey,
    Please use PuppetMaster.AddMuscle() for that (see PuppetMasterHierarchyAPI.cs).
    If you are trying to add a prop, please see the "Prop" demo.

    Hey,
    In that case, you would need to destroy the rigidbody on the prop, parent it's colliders to the ragdoll hand and parent it's mesh to the character hand. Getting rid of the Rigidbody allows the prop colliders to be used by the hand rigidbody as a Compound Collider. If you drop the prop, you can just reverse everything and add the rigidbody back to the prop.

    Hey,
    What does it looks like in slow motion if you scale down the timescale? Do the blue lines drawn by "Visualize Target Pose" twitch too or is it just the ragdoll? Do you still see it when you set PM "Mapping Weight" to 0?

    Best,
    Pärtel
     
    matteumayo likes this.
  37. PeterBrown

    PeterBrown

    Joined:
    Sep 11, 2013
    Posts:
    72
    hey, thanks :) this wont work in the editor mode, right? so runtime only?
     
  38. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,677
    Correct.
     
  39. PeterBrown

    PeterBrown

    Joined:
    Sep 11, 2013
    Posts:
    72
    kk, but what would be the way to set this up in the editor? i have a humanoid rig for some extra bones for the tail and wanted to write a little helper script that is setting up the 3 tail bones for puppetmaster more or less on a button klick. so adding 3 more bones to the muscle array
     
  40. Necka_

    Necka_

    Joined:
    Jan 22, 2018
    Posts:
    154
    Hey Partel,

    Thanks for the updated demo, I setup a small test. The goal will be that a ground smash attack from the player will make the ennemies bump in the air. For the test I've setup a small flow (using Bolt, but that doesn't really mater as the result is the same). I have a trigger collider around my player, it gather everything from the "Ragdoll" layer in a sphere radius. Then when pressing "spacebar" I set the BehaviourPuppet.State.Unpinned and then apply the AddExplosionForce (source of explosion is my player)

    As you can see it partially works, but the result is quite strange:



    The Character kind of roll on himself in the air but the bad part is that 50% of the time it gets stuck in the terrain, and also the puppet is kind of losing track of the character and in the result of that, the transform is off and the Ragdoll slides back into the Character.

    This sliding issue, I got it too when I tried with weapons hit (the Player hit the Puppet with a weapon that collides with it. The Puppet fall and then slides back to its root character)

    I played quite a while with the settings here and couldn't find how to make it works properly. I see that Ootii Motion and Actor controllers get disabled at the right time, I'm not sure if it is related in this case

    If you have any ideas, I'll take them. I'll also view your tutorial videos once again
     
  41. Useless-Media

    Useless-Media

    Joined:
    Apr 19, 2015
    Posts:
    104
    Yes really im waiting for this.


    This is in slow motion by a timescale of 0.1, the spikes getting smaller.

    It looks like they are invisible but when you watch the scope (thats why i really don't like the bug) you still see every spike, i know its not the usual way to having a First Person System like this but it really works except for the spikes.

    I realized i have something to do with the FixedUpdate because when i change the Fixed Timestep to 0.03 it become more invisible like on 0.02, but this can also come because of the FPS change.

    It become smaller when i turn the Mapping Weight to zero but still on the scope you see it.

    About the Visual Target Pose, this thing getting crazy on Props when you have it on active mode.
    2018-07-04 04_16_24-Window.png
    It looks like they pointing to a Transform but its all a little shift in other directions, for example when you watch the InteractionObject on the gun ( which is normal that it is in this position but ) the line carst of the Visual Target Pose pointing in a other direction.
    Its really just the Prop, other Muscles gets perfectly displayed.

    When you need to have a close look i also can give you access to the studio repo.
     
    Last edited: Jul 4, 2018
  42. Useless-Media

    Useless-Media

    Joined:
    Apr 19, 2015
    Posts:
    104

    I know this brings you more trouble than before but a work around would be setting the BehaviourPuppet of the enemy from Unmaped to Active, this always have the ragdoll active and provide this situations.
    Let me know if im right.
     
  43. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,677
    Ok I see... That's how:

    Code (CSharp):
    1. Muscle newMuscle = new Muscle();
    2.         newMuscle.joint = joint;
    3.         newMuscle.target = target;
    4.         newMuscle.props.group = Muscle.Group.Arm;
    5.  
    6.         System.Array.Resize(ref puppetMaster.muscles, puppetMaster.muscles.Length + 1);
    7.         puppetMaster.muscles[puppetMaster.muscles.Length - 1] = newMuscle;
    Hey,
    I've seen this kind of sliding across the floor when getting up once before. It was because of a wrong bone used for pelvis in the Humanoid Avatar Configuration. The pelvis bone used was the parent of the real pelvis bone and it was positioned down on the ground level, not at the hips. Please check the avatar configuration scene and make sure the bone assigned for hips is where it's supposed to be. If it's not, change it and rebuild the puppet.

    Hey,
    If it happens with mapping weight 0, it means it does not come from PuppetMaster. PuppetMaster might just magnify the issue. It comes from either the animation or IK. Maybe the animation is not set to loop right and so it jumps?
    Try setting mapping weight to 0 and also all IK weights to zero to see if its the IK or the animation.

    Cheers,
    Pärtel
     
    Useless-Media likes this.
  44. Necka_

    Necka_

    Joined:
    Jan 22, 2018
    Posts:
    154

    Good catch :) "Root" was assigned to the hips instead of Pelvis

    thanks a lot!
     
  45. Necka_

    Necka_

    Joined:
    Jan 22, 2018
    Posts:
    154
    So clearly it's way better now. I even replaced the Puppet and Fall animations and it's really nice when I do a ground smash the character is propelled a bit in the air and get back up nicely

    I do have an issue which looks like a bug to me

    My character NPC has Ootii Motion Controller and the Bridge Ootii Puppet and is set to "Use Transform" so I can use it with Nav Mesh (in case it's important for the next part)

    upload_2018-7-5_4-13-33.png

    When the character is propelled into the air, it lands somewhere else (let say 4 meters from its start point)

    The root object and all transforms are in the landing place. But not the "Behaviours" Child which stays in place

    Here is what I mean:

    upload_2018-7-5_4-9-53.png

    upload_2018-7-5_4-10-0.png

    That could be harmless, but I have a little script that makes the player automatically locks on its rotation to face the NPC it is attacking.

    It uses the root object of the npc to lock the rotation and strangely it picks all the time the Behaviours transform as it is probably confusing in Unity.

    Is it a bug? is there a way to force the Child "Behaviours" to always stick to the main parent transform like it should do?
     

    Attached Files:

  46. Useless-Media

    Useless-Media

    Joined:
    Apr 19, 2015
    Posts:
    104
    Hey,

    It probably still have something to do with puppet master, i weight out the Mapping Weight and at this point i need to correct me i just watched on a blue ball to debug and as i weight out the ball was still shaky so i thought it was the weapon which is shaky.

    Now i realized that the blue ball was in the ragdoll hierarchy as a child of the prop collider.
    This ball what is moving here is also in the PM collider hierarchy and PM mapping weight is zero.

    shakyPuppet.gif

    Also when i set PM to disable mode its totally stable.

    I think the collider freaking out here

    EDIT: I removed all scripts from the player and it looks like this is the solution, i think everything works like it does but i have to much scripts on one GameObject which cosing this issue, i realized PuppetMaster have a higher magnification when the update loop from unity is not balanced.
    I try to separate the scripts in different locations as childs of actual Player GameObject and optimize it.
    Probably will message you again if this is not working out.
     
    Last edited: Jul 6, 2018
  47. Ragoo

    Ragoo

    Joined:
    Feb 15, 2014
    Posts:
    60
    Hi Partel,

    Recently I've been running into an issue whereby the puppet occasionally explodes when switching from Kinematic/Disabled to Active state.

    I thought it was due to external collisions or the puppet behaviour, but I've narrowed it down to simply the enabling/disabling procedure.

    I've set up a script that switches the active state every n seconds. Every 10 - 20 cycles, it goes haywire as the attachment shows. In this example, no behaviours are active and the character controller and animator are disabled.

    Do you have any experience with this and know how to fix this?

    Thanks
     

    Attached Files:

  48. Necka_

    Necka_

    Joined:
    Jan 22, 2018
    Posts:
    154
    Following my issue above on the Child of my root, I really can't figure out how to have the "Behaviour" transform to stick to the root transform when Puppet is unpinned.

    It's quite a huge issue for me because at the moment I'm using a sphere collider trigger on my main player to feed a list of all "puppet" components close to him. So I can then unpin them at will (like when I do a RigidBody Explosion)

    That works the first time but then as the Puppet transform stayed in-place, my sphere collider doesn't catch the Puppet component anymore and so I can't unpin at will.

    My knowledge is maybe limited but I thought that any children of a parent transform would stay at the position of the parent
     
  49. maxloh_unity

    maxloh_unity

    Joined:
    Jul 9, 2018
    Posts:
    1
    Just looked at the page -- this thing costs $90 for hobbyists, and plus/pro gets a discount? Surely that's not right; hobbyists should be able to try for free and only pay if we make a profit, just like Unity's pricing model no? Otherwise how is anyone going to be able to afford to experiment with it?
     
  50. Necka_

    Necka_

    Joined:
    Jan 22, 2018
    Posts:
    154
    Unity Plus/Pro Discount IS Unity pricing model.

    The whole asset store concept IS Unity pricing model.

    You should complain about this to Unity, not to a dev making its job and selling its product at a very reasonable price for what it is.

    Game Development isn't cheap, far from it.
     
    Partel-Lang likes this.