Search Unity

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:
    2,556
    Hey,
    Would also like to point out that if you add joints that connect the PuppetMaster ragdoll to anything else, you'll have to set pin weight to 0 for the puppet or at least the body part that was connected, because the pinning forces would try to keep the ragdoll pinned to the animation and the added joint would conflict with that and they would end up pulling the ragdoll to pieces when the forces get big enough.

    Hey, thank you very much for sharing, appreciate that!
    I'll try to update the integration for the next version. It is crazy, game tech evolution seems to be accelerating exponentially these days, so many updates to everything, including Unity.

    Best,
    Pärtel
     
  2. XDura

    XDura

    Joined:
    Oct 27, 2016
    Posts:
    26
    Hi!, if I change a skin of the player at runtime, so all the targetTransforms are destroyed and recreated.
    How can I rebuild the puppet?
    I manually went over all muscles assigning the new TargetTransforms and did a PuppetMaster.Initiate but it doesn't work

    Thanks
     
  3. sordidlist

    sordidlist

    Joined:
    Sep 2, 2012
    Posts:
    86
    Hello! I am enjoying PuppetMaster, and read somewhere that there's an integration in the works for Opsive Ultimate Character Controller? I'm making a fighting game and if I could use FIK, PM, and UCC all at once it would be so cool! Thanks!
     
    tcmeric and Deckard_89 like this.
  4. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,556
    Hey,
    The best way to have multiple skins per character would be to just have multiple SkinnedMeshRenderers that use the same rig. Switching them would be easy. If the bone hierarchies don't match, then you can't share the PuppetMaster rig, you should have a puppet rig for each skin and instantiate the one you wish to use.

    Hey,
    Yes, it has been delayed for a while now for other priorities, but I'll pick it up again since you asked :).

    Cheers,
    Pärtel
     
  5. sordidlist

    sordidlist

    Joined:
    Sep 2, 2012
    Posts:
    86
    You're the man! I appreciate it very much. I know there's at least a handful of us out there for whom this would be the secret sauce to some really fun stuff.

    Thanks again!
     
  6. jfonz001

    jfonz001

    Joined:
    Jul 19, 2017
    Posts:
    18
    UPDATE:
    I think I figured it out. I had to give my Player controller a rigidbody and set the animation controller to this:

    Apply Root Motion: Unchecked
    Update Mode: Animate Physics
    Culling Mode: Always animate

    There is still some slight stuttering, probably just due to my awful walking animations and whatnot. My plan is to disable the puppet until I need it anyway.

    I do notice though that if I disable the puppet master and then re-enable it, my character's arms seem to fly back to their initial position when the scene started. Kinematic works fine though. Any idea why that might be? Thanks.

    Hey Partel,

    I am having trouble with my player "stuttering" while moving. I am using Aron's A* Pathfinding to move my characters. I have stripped down my player to pretty much just the model, puppet, and controller (no behaviors). In the stripped down version it seems to be smooth, so I think it may be something I am doing...that being said I then took my stuttering player (the full version) and stripped out all but the essential components and I am still experiencing the stutter. The scripts remaining on the player after this shouldn't be having any impact and at that point both versions of the player are using the same methods to move across the world.

    I made a video to help explain. The stuttering doesn't seem as bad here but if you notice, the unit closer to the camera is stuttering while the far (stripped down) unit is much smoother. Please ignore the error messages you might notice at the bottom, those are in regards to some missing components that are in my test scene and are unrelated to movement (just saving, loading, scene management etc.)



    Both units have a box collider on their controller. All colliders (the box and the puppet colliders) are set to "Player" and should not collide with eachother.

    I also see that the feet are dragging in both cases, but I think that is a separate issue as the dragging feet doesn't seem to be slowing down or causing the stuttering in the stripped down unit.
    Thank you
     
    Last edited: Jun 1, 2019
  7. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,556
    Hey,
    If there is stuttering only noticeable from a camera view point, it is because the motion of the camera and the motion of the puppet are out of sync. If your camera is updated in LateUpdate, make sure to add your camera updating script to a higher value than PuppetMaster.cs has in the Script Execution Order. Then also enable Interpolation on all the ragdoll Rigidbodies. Also make sure the character controller rigidbody is set to interpolate if you have it.

    Best,
    Pärtel
     
  8. gliealonso

    gliealonso

    Joined:
    Oct 21, 2018
    Posts:
    117
    Hello there,

    I started using the new PuppetMaster, and I noticed that my characters now stay a about 2 meters floating on the air, and I even tried to recreate the from scratch, and the issue still happpened, such as the image below:
    upload_2019-6-9_21-15-21.png

    And I also noticed this message that I didn't understand:
    upload_2019-6-9_21-16-46.png

    Is this happening with anyone else?

    Warmest regards,
    Gabriel.
     
  9. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,556
    Hey,
    Haven't seen this problem before. Any chance you could send me a repro or some instructions to reproduce the issue?

    Best,
    Pärtel
     
  10. jfonz001

    jfonz001

    Joined:
    Jul 19, 2017
    Posts:
    18
    Hey Partel,

    I'm hitting this error when equipping a prop to my characters.

    https://imgur.com/a/Q0PImec

    This only happens if I try and equip the prop as soon as I hit play. If I use a coroutine to wait a few seconds before actually equipping the prop I do not get this error, so I'm wondering if it's a race-case sort of thing.

    I added some values to your debug message to try and see what is going on. As you can see the positions between the two are just slightly off. I'm wondering if it's because I am not having the unit "pick up" them items, but instead am instantiating a new clone of a prefab and then immediately equipping the prop to the prop root. Again, seems to work fine if I wait a few seconds (or even equip the prop normally mid-game). It just seems to happen if equipping right when the game starts and I'm wondering if maybe my scripts are running before your scripts are ready?

    Thanks

    Edit: I just wanted to add that I have basically applied a band-aid coroutine that waits a few seconds before equipping items after I run the game in the editor. I just wait one second, then continue on, and I don't hit this error and the prop is equipped just fine. I am pretty sure that I am equipping the prop "too soon", before something in puppet master is ready, perhaps. Any clue what that might be?
     
    Last edited: Jun 15, 2019
  11. gliealonso

    gliealonso

    Joined:
    Oct 21, 2018
    Posts:
    117

    Hi Partel,

    So I even tried creating a new project and reinstalling Final IK and the newest PuppetMaster.

    What I do is, I create a full body biped ik, then use the ragdoll creator, then create the puppetmaster, and that is it. It used to work perfectly before, but now my character just suddenly goes up 2 meters above the air.

    Looking forward to hearing from you.
    Warmest regards,
    Gabriel.
     
  12. jfonz001

    jfonz001

    Joined:
    Jul 19, 2017
    Posts:
    18
    Hey I'm no expert by any means, but that warning message in your screen shot is basically saying that when you create the Puppet it will separate the instance you are working on from it's prefab. So basically you just have to make a new prefab.

    For your issue, I would check and make sure that all elements of your character (the mesh, the armature, the puppet, the controller) are all set to the same position. You can also make sure that the ragdoll or puppetmaster colliders and the character controller colliders are playing nice and not set to collide with each other. Maybe they are pushing each other around?
     
  13. gliealonso

    gliealonso

    Joined:
    Oct 21, 2018
    Posts:
    117
    Thanks for your reply, JFonz.

    The mesh, armature and puppet all seem fine, it was working before, and I did make the colliders not collider with each other.

    Not sure why this is happening now, but I am in no hurry to fix it though hehe

    Thanks for your reply once again,
    Gabriel.
     
  14. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,556
    Hey, thanks for sending me the model, I just replied to your email.

    Best,
    Pärtel
     
    gliealonso likes this.
  15. BenWoodford

    BenWoodford

    Joined:
    Sep 29, 2013
    Posts:
    116
    Started playing with this today but having a peculiar issue - when using Frozen after the kill time the rig does this weird thing where it rotates to be semi-upright but with all the bone positions it had on the floor. Like it's been frozen solid and picked up. It seems like it's setting it back to the origin of the parent maybe?
     
  16. gliealonso

    gliealonso

    Joined:
    Oct 21, 2018
    Posts:
    117
    Hi Partel,

    I hope you are well.

    Could you please help me with an issue with the Prop Master Melee?

    On the weapon prop, it needs a RigidBody, and I am using that rigid body to get collisions and velocity speed, however when I start the game, the rigid body is destroyed
    upload_2019-6-24_20-12-30.png
    upload_2019-6-24_20-13-14.png
    upload_2019-6-24_20-13-59.png

    Do you know what could be the issue?

    Many thanks!
    Gabriel.
     

    Attached Files:

  17. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,556
    Hey,
    I haven't seen this issue before. Can you please let me know how I could reproduce this issue in one of the demo scenes maybe or send me a repro that I could take a look at?

    Hey,
    The new prop system needs to destroy the rigidbody when the prop is attached to the ragdoll. That is for performance reasons, as the prop muscle already has a rigidbody. It adds the rigidbody back when the prop is dropped.
    So if you have references to the prop rigidbody in your own scripts, change them to this:

    Code (CSharp):
    1. public Rigidbody rigidbody {
    2. get {
    3. if (_rigidbody == null) _rigidbody = GetComponent<Rigidbody>();
    4. return _r;
    5. }
    6. }
    7. private Rigidbody _rigidbody;
    Best,
    Pärtel
     
  18. jfonz001

    jfonz001

    Joined:
    Jul 19, 2017
    Posts:
    18
    Hey Partel,

    EDIT: I think I can do this by playing with Collision Resistance, but any other input is much appreciated, especially on how to make my player's sword less "floppy", life a wiffle ball bat.

    I'm working on Melee combat. When my attacker swings at his target he doesn't seem to be able to transfer the force of the blow completely to the target. The target puppet flinches a little, but the attacker's weapon will glance off. If the attacker is standing too close and his arms also hit the target, it's as if the attacker is crashing against a wall and he will sort of crumble to the ground.

    Occasionally, I can angle my attacker just right to where his weapon follows completely through most of the animation and the target is slammed to the ground by the force of the blow. This is more what I'm looking for.

    Is there some sort of settings for making certain animations "more rigid"?

    I am only using the Puppet Behavior with no animations on fall. If the puppet is hit hard enough they will go down.
     
    Last edited: Jul 2, 2019
  19. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,556
    Hey,
    First, make sure the layer of the prop is included in BehaviourPuppet's "Collision Layers".
    Also increasing the mass of the prop helps.

    It will probably not be enough punch still, so you might need to make use of the Boosters like in the Melee demo. Boosters give temporary immunity and/or impulse magnification (damaging other puppets more) to the puppet.
    Declare a
    Code (CSharp):
    1. public Booster booster;
    and fill it in in the editor. Set Groups to Prop and Hand, Immunity to maybe 0.5f and Impulse Mlp to something like 5.
    When you trigger the attack animation, call
    Code (CSharp):
    1. booster.Boost(behaviourPuppet);
    .
    The duration of the boosting effect is defined by "Boost Falloff" in BehaviourPuppet.

    Best,
    Pärtel
     
  20. kvachanpavel_unity

    kvachanpavel_unity

    Joined:
    Jul 6, 2019
    Posts:
    1
    Hi Partel:
    I bought and now try to combine the puppet master and final ik and ran into a problem. When I change the position of the effector bone final ik, the remaining bones of the character are pulled to the starting position. Also in the puppet master I set the Pin Weight to 1 and I basically lost all the physicality of the character. I would like to get a character's behavior like that of Clumsy Ninja, when we lift the character above the ground for some kind of limb. I looked at all the examples (including Mapping To Ragdoll), but could not find a solution. Maybe there are some ideas on how to do this?
     

    Attached Files:

  21. borkbork

    borkbork

    Joined:
    Jul 5, 2014
    Posts:
    64
    Hi Partel, kudos for the excellent work. I am working on integrating PM with Ootii's MC - I found an update to your integration package on this forum "Ootid's Motion Controller v2.73 (Unity 5.5.0)". Just wondering if this forum is the best place to find these kinds of things / if this is the most recent package?
     
  22. borkbork

    borkbork

    Joined:
    Jul 5, 2014
    Posts:
    64
    Curious, is it possible to dismember a PM rag doll?
     
  23. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,556
    Hey,
    In FBBIK, if you set "Pull" weight to 0 for all the limbs except for the one that you pull from, you will be able to drag the character as far as you like.. But that's not how you do stuff like pulling that ninja by its hand. To drag a puppet physically, add a FixedJoint between the hand rigidbody and a kinematic rigidbody, then set pin weight to 0 in PuppetMaster or if using BehaviourPuppet, call behaviourPuppet.SetState(BehaviourPuppet.State.Unpinned); and set behaviourPuppet.canGetUp to false until the hand is released. Then it will be pretty much like the "Hanging" demo in PuppetMaster.

    Hey,
    I update the integration packages every time I push a new version, but 3rd party publishers update their stuff quite often sometimes breaking the integration. I don't get notified about those updates unless one of you guys writes to me here so I also reply here with a solution. I should make a page on the website with all the patches and updates easier to find, I'll figure something out ASAP..

    Hey,
    Yes, please check out the "Removing Muscles" demo. The next version will have a new much more efficient and performant API for dismemberment, that doesn't remove muscles, which is a very slow and GC allocating thing to do. Instead, it will basically just set joint X/Y/ZMotion to Free, that costs close to nothing.
    PM doesn't have a tool for cutting skinned mesh though.

    Cheers,
    Pärtel
     
  24. FiveFingerStudios

    FiveFingerStudios

    Joined:
    Apr 22, 2016
    Posts:
    510
    I’m currently using Final IK and UMA 2.7 and I’m looking to possibly integrate puppet master for mele combat with the player.

    All of my characters share the same skeleton. I have no idea how puppet master works so I’m just throwing this out there.

    Is it possible to have 2-3 puppets in my scene and swap them to NPCs as they get close to player? I’m asking because I pool my characters and just rebuild them on demand as they get killed and I don’t want to each one to have their own puppet when not close to the player.
     
  25. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,556
    Hey,
    Yes, you could set them up with PuppetMaster (current UMA integration is broken due to UMA update, but you can find instructions from this post by another user).

    You can keep the PuppetMaster components in Disabled mode normally, then switch them to Active mode when they get near to the player.

    Best,
    Pärtel
     
    hopeful likes this.
  26. khailDev

    khailDev

    Joined:
    Feb 6, 2018
    Posts:
    10
    hello , i'am having a problem with collision detections , it's working 85% but the rest no detection at all during the whole scene so i have to restart it , when it's not working the characters go throught the obstacles and 0 detection at all
     
  27. sordidlist

    sordidlist

    Joined:
    Sep 2, 2012
    Posts:
    86

    When you notice this happen, make a note of which obstacles they go through. Turn off play mode, go back into your scene editor, and make sure that the obstacle has a collider too. Also make sure your colliders aren't too small, and lastly, make sure that "Is Trigger" is turned off.
     
  28. khailDev

    khailDev

    Joined:
    Feb 6, 2018
    Posts:
    10
    when it happens they go through everything not only one object , in the same scene with the same obstacles , 85% works but sometime if you just reload the scene with 0 change sometimes the collision doesn't work at all during the whole level but when you reload the level it works the next time
     
  29. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,556
    Hey,
    If its not just the fixed time step being too low and colliders with Discrete collision detection mode skipping colliders, there might be a script (maybe LayerSetup.cs that is used in most PM demo scenes to set up project layer collisions in play mode so the demos would work without PM having to mess up your layer collision setup in editor mode) or some other script you may have that calls Physics.IgnoreLayerCollision(). If the problem happens again, please pause the scene and check the Layer Collision Matrix, see if the layers that are supposed to collide still collide.

    Best,
    Pärtel
     
  30. Utopien

    Utopien

    Joined:
    Feb 15, 2016
    Posts:
    46
    hello does puppet master can work with floating origin reposition how does it handle instant repositioning ?
     
  31. khailDev

    khailDev

    Joined:
    Feb 6, 2018
    Posts:
    10
    thank you for your answer :D , the fixed time step is as default , also i checked the layers when it happened again and everything is ok ,




    i used the third person controller with puppet master , the puppet master game object is totally off the scene but the third person controller is working fine and the player is moving normally the puppet is trying to move according to the animation but the position is off
     
  32. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,556
    Hey,
    I once made this prototype using PuppetMaster with an astronaut floating in space. It used 1:1 scale and continuous origin reposition since the sphere for the Earth was the scale of real earth, the gravity calculations were realistic and so the velocities of ragdoll rigidbodies were something like 7600 m/s. But that was continuous reposition so I basically just had to manipulate velocity. If you have snapping reposition after a certain distance, it can still be done. You'll just need to make sure do that as the first or last thing in the frame (Script Execution Order).

    Hey.. OK, when you play the scene and the bug happens, do you see any warnings or errors coming from PuppetMaster?
    If not, I can continue guessing, but it would be the quickest solution if it was possible for you to make a repo package so I could take a closer look.

    Cheers,
    Pärtel
     
    Utopien likes this.
  33. mackerbaehr

    mackerbaehr

    Joined:
    Apr 6, 2014
    Posts:
    2
    Hello
    Is it possible to export the output animation outside of unity through fbx?
     
  34. khailDev

    khailDev

    Joined:
    Feb 6, 2018
    Posts:
    10
    0 errors or warnings , the problem only happens sometimes most of the time(with the same scenes) it's working very good , what if i check at the start if the puppet is is far from the third person controller and if yes i respawn my characters ? how can i respawn the character to their original position ?
     
    Last edited: Jul 31, 2019
  35. Utopien

    Utopien

    Joined:
    Feb 15, 2016
    Posts:
    46
    thanks for your response !
     
  36. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,556
    Hey,
    I do have a WIP baking tool that can bake Final IK and also PuppetMaster to a .anim clip in Unity, works for both Humanoid and Generic rigs. I don't have an fbx export tool, but I've heard beta testers were able to export them using Unity's FBX Exporter tool or similar.

    Hey,
    It might be that your character controller script moves the character before PuppetMaster has had a chance to initiate.
    Could you see if you can add
    Code (CSharp):
    1. if (!puppetMaster.initiated) return;
    to the beginning of all methods you have that move or rotate the character to prevent that from happening?

    Best,
    Pärtel
     
  37. khailDev

    khailDev

    Joined:
    Feb 6, 2018
    Posts:
    10
    wow that solved the problem , awesome results i'am very happy with the outcome thank you very much :D
    ++ one last question XD , how can i transfer the player to another place by script , i tried transfering the third person controller but the puppet can't follow in one frame ...
    thanks :D
     
  38. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,556
    Hey, glad its fixed :)
    try calling puppetMaster.Teleport(...);
     
  39. khailDev

    khailDev

    Joined:
    Feb 6, 2018
    Posts:
    10
    Perfect everything is working like a charm , is there any specified approach for mobile devices for performence ?
     
  40. kingburrito666

    kingburrito666

    Joined:
    Jun 28, 2019
    Posts:
    2
    Is there any way you can make this work with the Physics Slot Recipe? The colliders are created on the fly and map to different DNA types.
     
  41. MostHated

    MostHated

    Joined:
    Nov 29, 2015
    Posts:
    1,235
    Hey there @Partel-Lang,
    I just had a quick question about the future of PuppetMaster/FinalIK. Are there any plans for making use of DOTS physics in hopes of better performance, or anything along those lines? Just wondering in general where you are expecting / wanting things to go in the future for these wonderful assets.

    Keep up the great work!
    -MH
     
  42. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,556
    No specific approach really, the performance guidelines here matter both on desktop and mobile.

    Hey,
    Not unless UMA adds tools to set up a ragdoll using a humanoid avatar and the physics slot recipe data only. Currently, looking at the code, I can't find any such tool.

    Hey,
    Last I checked, Unity Physics was still in it's early infancy and needs to mature quite a lot before it could handle anything like PuppetMaster and the performance still looks bad too. I will keep a close eye on it though...

    About the future plans, there will be major improvements to blowing off body parts and to prop workflow and performance for PuppetMaster with the next version (long overdue I know, still working out some minor problems).
    After that, Final IK will receive the Baker - a tool I've been working on for some time now, that enables you to bake animation clips, both Humanoid and Generic. You can use it on animation clips, Mecanim, layers of IK on top of Mecanim, ragdolls, PuppetMaster and Timelines and it will also have some keyframe reduction options that can get you better quality for multiple times smaller memory cost than Unity's built-in keyframe reduction. That will be followed by Timeline support, animation editing and IK keyframing tools for Final IK designed for making it super easy to edit and extend your mocap libraries in Unity.

    Cheers,
    Pärtel
     
    Subliminum likes this.
  43. MostHated

    MostHated

    Joined:
    Nov 29, 2015
    Posts:
    1,235
    I definitely understand about the new physics being premature and definitely not ready for consideration to actually using it. It was more of a general "if" kind of question, such as if Unity physics or Havok ends up being better and more performant would you be interested in utilizing them for PuppetMaster? Such as maybe a PuppetMaster2. I do also realize it is probably too early to even answer, so no worries about it, lol.

    As for the rest of the news, that is fantastic! I am always a fan of hearing about any and all performance enhancements. :D I am especially excited to hear about the dismemberment updates. I had spent a decent amount of time either last year or the year before trying to find something that was not a complete performance hog and when I saw PuppetMaster had it, I ended up playing around with the demo scene for at least an hour. I have yet to implement it into my current project, but might reconsider it once the proposed changes come around.

    Thanks for the reply, and I definitely look forward and will keep my eye out for these updates!
    -MH
     
  44. Deleted User

    Deleted User

    Guest

    Hey Partel,

    I have a question, how exactly find the Puppet Master Ragdoll Position?

    What I want to do is rotate the whole Ragdoll, the Ragdoll is in this moment Unpinned so I can't rotate the Target.

    I found out that puppetMaster.Teleport( Vector3, Quaternion, Bool ) works in this case ( Correct me if there is a cheaper way to rotate the ragdoll because calling the Teleport function every frame would be no good idea after looking at the code ).

    So option A to rotate the Ragdoll would be using Teleport, but I have to figure out the position which has to stay the same as the current ragdoll position, option B would be to just rotate the Hips but I did not figure out the correct rotation in this case because the RB is in a strange direction.

    EDIT: I found out it's the Player Gameobject who defines the position of the Ragdoll on the Teleport, well that's no option for me because this transform is relative to the hips muscle in this special case...
     
    Last edited by a moderator: Aug 15, 2019
  45. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,556
    Hey,
    Yes, of course, when Unity Physics or Havok ends up being better, I will try my best to integrate. Especially if either one allows me to get rid of the dual rig structure of having a separate ragdoll and reorient joint default rotations. Currently I don't think Unity Physics even allows for joint target rotations, which is essential for active ragdoll stuff. Having open source code for Unity Physics is certainly a big plus though.

    Hey,
    You could just move the PuppetMaster gameobject, as the ragdoll is parented to it.
    For example to move/rotate around the hips:

    Code (CSharp):
    1. public static void RotateRagdoll(PuppetMaster puppetMaster, float angle) {
    2. Vector3 pelvisPos = puppetMaster.muscles[0].joint.transform.position;
    3.  
    4. puppetMaster.transform.rotation = Quaternion.AngleAxis(angle, Vector3.up) * puppetMaster.transform.rotation;
    5.  
    6. puppetMaster.transform.position += pelvisPos - puppetMaster.muscles[0].joint.transform.position;
    7.  
    8. }
    Best,
    Pärtel
     
    Deleted User and MostHated like this.
  46. PlayingKarrde

    PlayingKarrde

    Joined:
    Aug 19, 2013
    Posts:
    38
    I know this is several years old now but since I came across it during a Google search I thought I would reply in case anyone else is also looking for the solution.

    Essentially what I did to have the same problem was to accidentally increase the mass of the ragdoll in the ragdoll editor but many multiples (I think it ended up being like 100x haha). This basically meant my skeleton wasn't able to keep my bones on my body. I had to delete my ragdoll and start from scratch although I suppose it would be possible to fix by multiplying the number by a decimal amount (ie 0.5 to halve).

    I now have a better idea of what it would be like to go to a larger planet, and it wouldn't be pretty that's for sure.
     
  47. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,556
    Hey,
    I guess I should add a Reset Default Mass button to RagdollEditor, I'll put it down in my list, thanks!


    Guys, I will be out of town until 30th of August. Sorry about the inconvenience, please leave your questions here and I will attend to them as soon as I get back.
     
    MostHated likes this.
  48. JacobDzwinel

    JacobDzwinel

    Joined:
    Dec 19, 2013
    Posts:
    26
    Hi Partel!

    Since I'm working on optimization in my game I'm curious if it's possible to have my PuppetMaster and BehaviourPuppet deactivated when I want, and use it only when my character is unpinned or in getup state? I still need to have my Puppet muscles in kinematic mode and send hit collision messages but I see that there are a lot of background calculations that I don't need in my game because when my character get hit, I clear all velocities, switch my Puppet from Kinematic to Active, unpin it and give force manually (just to have better control of ragdoll forces). Everything works great, but I would like to get rid off other unnecessarily calculations while my characters aren't in unpin/getup mode.

    Do you think it's possible?

    Also can you help me how I can achieve "Domino effect" when I kick enemy and I want him to knock over other characters standing behind him with lower velocity change on contacts. When I'm increasing the mass, my character ragdoll behave really strange.

    Thanks!
     
    Last edited: Aug 26, 2019
    Hobodi likes this.
  49. Deleted User

    Deleted User

    Guest


    Thank you, it just works!

    I got problems with the Animation which was not always in the forward direction so I extended the method a little to this:
    Code (csharp):
    1.  
    2.     public static void RotatePuppetMasterRagdoll(PuppetMaster puppetMaster, Quaternion wantedRotation, Vector3 rotationOffsetEuler, float lerpSpeed ) {
    3.             var angle = 0f;
    4.             var angleAxis = Vector3.up;
    5.             var pelvis = puppetMaster.muscles[ 0 ];
    6.             var wantedEuler = wantedRotation.eulerAngles;
    7.             var baseRotationEuler = Quaternion.Euler( rotationOffsetEuler.x, pelvis.joint.transform.rotation.eulerAngles.y + rotationOffsetEuler.y, rotationOffsetEuler.z ).eulerAngles;
    8.             var differences = Quaternion.Euler(wantedEuler - baseRotationEuler);
    9.             differences.ToAngleAxis( out angle, out angleAxis );
    10.             Vector3 pelvisPos = pelvis.joint.transform.position;
    11.             puppetMaster.transform.rotation = Quaternion.Lerp( puppetMaster.transform.rotation, Quaternion.AngleAxis( angle, angleAxis ) * puppetMaster.transform.rotation, lerpSpeed * Time.deltaTime );
    12.             puppetMaster.transform.position += pelvisPos - pelvis.joint.transform.position;
    13.         }
    14.  
    With this it's getting the the rotation of the Hips instead of the PM root, it made my puppet more stable even with Animations who are rotating the puppet.
    I hope someone needs this as I did...
     
  50. MostHated

    MostHated

    Joined:
    Nov 29, 2015
    Posts:
    1,235
    I have been waiting for this since UCC came out unfortunately. My game heavily relies on PM, so I have been stuck using TPC v1 still. All the rest of the integrations I would need have came out so far minus PM, so fingers crossed it comes soon. : D