Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

PuppetMaster - Advanced Character Physics Tool [RELEASED]

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

  1. thestroyer_

    thestroyer_

    Joined:
    Oct 12, 2015
    Posts:
    10
    Hi! I am having some issues changing the puppet position instantly. I tried to use the method Teleport() of the puppet master, but it seems it doesn't work. When using the method you can see the puppet interpolating from his last position to the one that I told him, but when it finishes to interpolate, it keeps the inertia from the interpolation and unpins from the puppet master (even with pin weight and muscle weight at maximum).

    Mention that I have no behaviours attached to the PuppetMaster.
     
  2. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,548
    Hey,
    I never tried BehaviourDesigner myself so I'm not sure how to fix it. I think it might have to do with that (SharedFloat) thing, probably a global variable used for all instances. Maybe if you asked BehaviourDesigner guys, they probably will be able to help you.

    Hey,
    To make PM/VRIK update in FixedUpdate, all you have to do is set Animator to "Animate Physics" mode.
    It is OK to parent the character to the controller, just make sure the controller is not moved while behaviourPuppet.state != BehaviourPuppet.State.Puppet;

    I don't normally do paid support just because of the extra billing and accounting headache, but if you wanna add me to Discord, please PM me.

    Hey,
    Yes, the other method preserves all your linkages and it doesn't have to unpack the prefab either. All it does to the original is change it's transform.parent.

    Made a quick video for you showing how it should be done.

    Hey,
    Are you sure you are running the latest PM because I though I had all those problems fixed with the last version.
    The latest is 0.9, you can check it from the "PuppetMaster ReadMe" file under Plugins/RootMotion/PuppetMaster.

    Best,
    Pärtel
     
    Bauschen likes this.
  3. thestroyer_

    thestroyer_

    Joined:
    Oct 12, 2015
    Posts:
    10
    I am running the version 0.9.

    I have just found the issue. It seems that having the Pin Pow value high was the problem. Setting it to a lower value seems to fix the problem I had.

    Thank you and sorry for the inconvenience!
     
  4. AhJun

    AhJun

    Joined:
    Dec 30, 2019
    Posts:
    14
    Not sure if it has been asked before, but how do I make a prop affect the rig? For example, using a weapon to hit/block a prop that the rig is holding. Would it be hacky to just change the side of the hand collider and treat the prop as a hand?

    EDIT: nm, the Prop example has good info/comments about it!
     
    Last edited: Feb 21, 2020
  5. Redux

    Redux

    Joined:
    Nov 10, 2011
    Posts:
    146
    @Partel-Lang Very useful, thanks. I was wondering if I can make the puppet sync immediately to the animated model transforms on demand? I have need for such a use case.
     
  6. Sun-Pengfei

    Sun-Pengfei

    Joined:
    Nov 12, 2015
    Posts:
    37
    @Partel-Lang Hi Pärtel, really love Final IK and PuppetMaster. I have some inquiries regarding them. I've sent email to CONTACT@ROOT-MOTION.COM, but got no reply yet. Sorry to push this way, but my project is stuck right now. Could you check it out please? Many thanks!
     
  7. Deleted User

    Deleted User

    Guest

    Hey,
    Currently, I experience an issue with my setup, not really sure who to ask because it's also controller related, however, I set up the Props on my character and for some reason the prop makes the controller stuck.

    But I don't think it's depending on the controller force I think it has something to do with the physics because using a non-friction physics material is minimizing the issue so it only occurs sometimes.

    Here a small video of the issue: As you can see make the sword stuck the controller


    What I did and I think that's a valid point that I use the Unmapped Mode on the Behaviour Puppet but also release the Joint angular motion to free after the prop is equipped.

    But after all, I have no idea what's can cause this, maybe I'm lucky and get a reply :)

    EDIT: Figured out it has something to do that I changed like mentioned above the Join angular motion to free.... without it's gone but brings another issue as I want to have a free motion for the props with maybe just a tiny bit of control, I try to tweak the group values but did not come to a specific value where I archived this free behaviour... also I use the Unmapped state so I guess the props also stop using physics when there is no collision which is something I don't want because they should move free when the character is moving


    EDIT Again:
    Well I figured it out, Puppetmaster works fine with the Joint angular motion set to free, the issue was that I did not notice a collider in the Prop Target Hierarchy which made the controller stuck but by disabling the collider all works fine :)
     
    Last edited by a moderator: Feb 26, 2020
  8. alsomitra

    alsomitra

    Joined:
    Aug 31, 2017
    Posts:
    33
    Hey,

    I want to make the kick and punch characters temporarily invincible.
    It is strange that an attacker falls into a collision.
    Which parameters need to be adjusted to make the character invincible?
    If someone asked the same question in the past, sorry.

    Thank you very much
     
  9. nobluff67

    nobluff67

    Joined:
    Nov 3, 2016
    Posts:
    338
    Putting my question here as your website Q&A is getting spammed to death....

    I am 99% sure I saw a video of yours where you can increased the size of a puppets components through a slider e.g. make the hands larger. I can not find the video, which means its my imagination or maybe in final ik? Can you tell me if this exists? If yes, where is the video or how to.

    Thanks.
     
  10. Milionario

    Milionario

    Joined:
    Feb 21, 2014
    Posts:
    138
    Is the stagger behaviour only available on Final IK?
     
  11. Danirey

    Danirey

    Joined:
    Apr 3, 2013
    Posts:
    548
    Hello Partel and nice people,

    i have a question about puppetmaster events. How should i go to achieve the following. If a character looses balance, since it is a turn based game, i want it to stay in the ground until the next turn. I have tried sending the kill function when the puppet is knocked out, and set the state.alive, at the turn beginning. It could work like that, but ideally the puppet should go to a lay down animation after loose balance and then i call the getup function in the next turn, which now is automatically called by the behavior i think.
    Any recommendation?

    thanks a lot and best regards!
     
  12. Milionario

    Milionario

    Joined:
    Feb 21, 2014
    Posts:
    138
  13. alexkarak

    alexkarak

    Joined:
    Feb 7, 2018
    Posts:
    28
    Hey Partel I am using this script to add damage to my enemys AI.But currently the damage is applied even if the Ai collides with the envirorment or with each other (and the damage they take is too little ...most of the times even though they ve been hit they take no damage)....and i want them mainly to take damage only from my Player if possible..and to make its hit apply more damage (if i can tweak something in puppet behaviour of my ai or my player to achieve "better or stronger hits")
    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using RootMotion.Dynamics;
    5. using BehaviorDesigner.Runtime;
    6.  
    7. public class Cop : MonoBehaviour
    8. {
    9.     public BehaviourPuppet puppet;
    10.     public BehaviorTree behaviorTree;
    11.     public SharedFloat health;
    12.     public HealthBar healthbar;
    13.     public SharedBool Hit;
    14.    
    15.     void Start()
    16.     {
    17.        
    18.         puppet.OnCollisionImpulse += OnCollisionImpulse;
    19.         health = (SharedFloat)behaviorTree.GetVariable("health");
    20.         healthbar.SetMaxHealth(health);
    21.         Hit = (SharedBool)behaviorTree.GetVariable("TakeDamage");
    22.  
    23.     }
    24.  
    25.     private void OnCollisionImpulse(MuscleCollision m, float impulse)
    26.     {
    27.  
    28.         health.Value -= impulse/100;
    29.         behaviorTree.SetVariableValue("health", health);
    30.         healthbar.SetHealth(health.Value);
    31.         Hit.Value = true;
    32.        
    33.         if (health.Value <= 0f)
    34.  
    35.         {
    36.             behaviorTree.SetVariableValue("health", 0f);
    37.             puppet.puppetMaster.Kill();
    38.         }
    39.     }
    40.    
    41.    
    42.  
    43. }
    44.            
    45.    
    46.  
     
  14. gliealonso

    gliealonso

    Joined:
    Oct 21, 2018
    Posts:
    117
    Not sure if I understood you. But I believe your character is losing balance when he's punching or kicking, is that correct?

    If that's the case, tryi setting the "Knockout Out Distance" to 10.

    You can leave it fixed on the public field or change whenever you want through code
     

    Attached Files:

    Partel-Lang likes this.
  15. gliealonso

    gliealonso

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

    There is a scene called "Scaling" =)
     
    nobluff67 and Partel-Lang like this.
  16. gliealonso

    gliealonso

    Joined:
    Oct 21, 2018
    Posts:
    117
    Hi,

    Do you want to do that because you want the character not to fall in certain moments?

    If that's the case, what you can do is, increase the Collision Resistance to a very high number, such as 9999999, and also set the Knock Out Distance to 10, which you can also do by code.

    I attached an example. If that's not the case, then only Partel can help you xD
     

    Attached Files:

    Partel-Lang likes this.
  17. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,548
    Hi guys, very sorry for the long wait, was out of town on vacation last week.

    Code (CSharp):
    1. foreach (Muscle m in puppetMaster.muscles)
    2.         {
    3.             m.MoveToTarget();
    4.             m.ClearVelocities();
    5.         }
    Hey,
    Sorry for the way, was on vacation last week, will reply to you ASAP!

    Hey,

    You should use the Boosters. Declare a public Booster booster; fill it out in the editor. It can be used to give temporary immunity and/or impulse multiplier to the puppet. To use it, call booster.Boost(behaviourPuppet); The boosting effect will fade out over time , defined by Boost Falloff in BehaviourPuppet. Value of 1 means the effect will be gone in 1 second.

    Hey,
    Yeah, I'm deleting spam almost every day, but was on vacation last week, sorry about that.
    Please check out the "Scaling" demo in PM, I think that's what you saw.

    Hey,
    If you're looking to optimize puppets while they need no physics, you should set puppetMaster.mode to puppetMaster.Mode.Disabled. That deactivates the ragdoll and the behaviours will not run at all and you will not get any collisions processed.

    But if you did this:
    Code (CSharp):
    1.  foreach (Muscle m in puppetMaster.muscles)
    2.         {
    3.             m.broadcaster.enabled = false;
    4.         }
    That would prevent collision events from being sent to BehaviourPuppet.

    Hey,
    Looking at that gif, could try going to BehaviourBipedStagger and increase maintainRotationWeight to something like 0.5f on lines 262 and 263 to reduce the tip toeing effect.

    Hey,
    OnPre/PostSimulate are there for projects that need to have Physics.autoSimulation disabled. Then PuppetMaster can be updated manually like this:

    Code (CSharp):
    1. foreach (PuppetMaster puppetMaster in puppetMasters)
    2.             {
    3.                 puppetMaster.OnPreSimulate(deltaTime);
    4.             }
    5.  
    6.             Physics.Simulate(deltaTime);
    7.  
    8.             foreach (PuppetMaster puppetMaster in puppetMasters)
    9.             {
    10.                 puppetMaster.OnPostSimulate();
    11.             }
    Mapping happens in LateUpdate when your Animator is in Normal mode and in FixedUpdate when in AnimatePhysics mode.

    Why exactly do you need to map before LateUpdate? If you did it in Update, your mapping would happen before animation so that would just overwrite it.

    Hey,
    You should check for the layer of the colliding object (m.collision.collider.layer), to see if it was another puppet or something else and multiply damage accordingly. Could also check for if (m.collision.collider.attachRigidbody == null || m.collision.collider.attachedRigidbody.isKinematic) to identify collisions with static objects.

    Cheers,
    Pärtel
     
  18. alexkarak

    alexkarak

    Joined:
    Feb 7, 2018
    Posts:
    28
    And how do I prevent collisions with other AI puppets since both AI and the player have the same layers?
     
  19. nobluff67

    nobluff67

    Joined:
    Nov 3, 2016
    Posts:
    338
    Thanks! So not a video I saw, but a example scene.
     
  20. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,548
    Hey,
    You mean you want all your AI puppets to ignore collisions with each other but not the player?

    If so, you'll have to move the player to another layer and disable AI layer collisions with itself.

    1. OK, I see. Sorry, I didn't think about it at first because nobody has asked about it for years, but the intended way of handling custom puppet controlling logic would be to make a custom puppet behaviour.
    Check out BehaviourTemplate.cs. Make a new script MyBehaviour.cs that extends BehaviourBase. You can actually leave it empty like that if you don't want it to do anything. Make a new GameObject next to BehaviourPuppet and add MyBehaviour on that. The point is, to completely disable BehaviourPuppet, just call myBehaviour.Activate();
    Call behaviourPuppet.Activate() to resume to BehaviourPuppet.

    2. At which point in the update cycle are you creating the duplicate? Might just work if you do it from another point in time, like maybe use LateUpdate of a script that runs after PuppetMaster (Script Execution Order). Then your duplicate would be identical by rendering time and start performing on it's own the next frame.

    Cheers,
    Pärtel
     
  21. Danirey

    Danirey

    Joined:
    Apr 3, 2013
    Posts:
    548
    You missed this one! ;)
     
  22. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,548
    Oh, sorry!
    Please just set behaviourPuppet.canGetUp to false and it will stay down.
     
    Danirey likes this.
  23. Danirey

    Danirey

    Joined:
    Apr 3, 2013
    Posts:
    548
    So easy, as always!

    Thanks a lot!
     
  24. alsomitra

    alsomitra

    Joined:
    Aug 31, 2017
    Posts:
    33
    Stagger and Baker

    Hey,

    I set up Baker in Stagger,
    Then a strange animation was created.

    Is this combination bad?

    Thank you
     
  25. Milionario

    Milionario

    Joined:
    Feb 21, 2014
    Posts:
    138
    How to combine stagger with lookat without producing jittering effects?
     
  26. ColtonKadlecik_VitruviusVR

    ColtonKadlecik_VitruviusVR

    Joined:
    Nov 27, 2015
    Posts:
    197
    Hey @Partel-Lang,
    I'm working on picking up items in VR using your prop system. At first I tried creating a prop muscle in the editor and using that to attach items. This lead to the item flipping/rotating erratically when switching the item between the players hands as I had to create a different position & rotation offset so that item fits correctly in hand. Next I tried creating a new prop muscle each time the player wants to pick something up, which is created with a position and rotation offset (the item now always goes to local origin of the prop muscle). This fixes the spinning issue and looks great, but I was wondering if there was a more performant way of doing this? (i.e. creating/destroying muscles seems like a waste if I could just move it). Is there a way I can move the muscle when it is disconnected?

    Also, If I must create/destroy prop muscles during runtime, what is the correct way to clean up after a prop muscle? Currently I am listening for a disconnect event and then a remove event but this is leading to an index out of range exception.

    Thanks,
    Colton

    EDIT: I have created a dictionary that maps the prop to the muscle with the correct offsets so I do not re-create muscles that have already been created/destroyed in the past (creates a prop muscle pool), however, the system breaks down for some reason if I switch hands more than once (i.e. Interact with right hand, stop, interact with left hand, stop, I cannot interact again with the right prop muscle). Any idea why?
     
    Last edited: Mar 10, 2020
  27. stevenwanhk

    stevenwanhk

    Joined:
    Jul 20, 2016
    Posts:
    113
    Hi @Partel-Lang, haven't caught up this for a while. Is Puppet Master using Job system or similar technology to improve performance? We found that having around 20 puppet master units would be maximum a year ago.
     
  28. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,548
    Hey,
    Those pilots in the stagger demo have Animator on the parent gameobject of the actual avatar (Pilot) and apparently that is a problem for Baker (HumanPoseHandler uses the wrong root transform). You'll just have to copy the Animator, remove it and paste it on the Pilot gameobject, then it will work. Once the clip is produced, select it and set all "Based Upon"-s to "Original" and enable "Bake Into Pose" for "Root Transform Position (Y)".

    Hey,
    I tried adding LookAtIK to the character in Stagger demo, but didn't see any jitter. Can you tell me how to reproduce this problem?

    Hey,
    It would be best to find the problem that was causing the flipping issue so you would not have to use any workaround hacks. Would it be possible for you to send me some kind of a repro so I could figure this out?

    I don't think jobs help much with that as main performance culprit is still physics processing. I will try Unity Physics for DOTS once it has matured some.

    Cheers,
    Pärtel
     
  29. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,548
    Hi all!

    Because of all the frequent automated spam, notification issues and other limitations of the old RootMotion Q/A page, I am nuking that and moving over to https://rootmotion.freshdesk.com/support/home.

    It has FAQ, categorized forum and a ticketing system so hopefully that will improve the support experience for you guys!

    Cheers,
    Pärtel
     
  30. Milionario

    Milionario

    Joined:
    Feb 21, 2014
    Posts:
    138
    Is there a reason the character on the stagger demo has a mass of 1 for all of its rigidbodies?
     
  31. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,548
    The behaviour just looks better with uniform mass, but it's not a must.
     
  32. TimHogklint

    TimHogklint

    Joined:
    Nov 24, 2017
    Posts:
    40
    Speaking of which - have you tried using the stagger with some machine learning ? Sorry if this been asked a million times.
     
  33. Abnormalia_

    Abnormalia_

    Joined:
    Jul 23, 2013
    Posts:
    128
    Hi all, is there way to get feet placement callback events in PM?
     
  34. ColtonKadlecik_VitruviusVR

    ColtonKadlecik_VitruviusVR

    Joined:
    Nov 27, 2015
    Posts:
    197
    Hey @Partel-Lang,
    I am still having a tough time deciding if the prop system is the way to go for our VR implementation and I was wondering if you could weigh in on the decision? If you were going to implement picking up items in vr (using VRIK and PM), how would you do it? The props seem to work well except that sometimes they don't effect the hand enough and rotate away when being pushed into geometry, if there was a way increase the effect the prop has on the arm that would work. Conversely, if I just parent objects onto the hand, everything stays together because they share a rigid body, but they don't rotate off objects nicely and I'm not sure how physically accurate everything will be.
    Do you have any thoughts on how to achieve a happy medium between physically accurate and looking good?
    Cheers,
    Colton
     
  35. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,548
    Hey,
    I have thought about it, but haven't had the time to put in the effort to see what it actually takes yet. Should be possible to use ML with PuppetMaster though.

    Hey,
    What exactly do you mean? PuppetMaster has no idea if the puppet's feet are grounded or not, it doesn't need that information normally.

    Hey,
    Please try tweaking some values like "Unpin Parents" in the Group Overrides of BehaviourPuppet. For example if you have a group override for the Prop group and increase "Unpin Parents" for that group, that would make collisions with the prop loosen the hand muscle some more (as it is the parent of the prop).

    What exactly did you mean by "they don't rotate off objects nicely" when the object colliders are parented to the hand?

    Best,
    Pärtel
     
  36. Milionario

    Milionario

    Joined:
    Feb 21, 2014
    Posts:
    138
    How to turn the whole Pilot with LookAtIK on the Stagger demo? Meaning it should stagger towards the target?
     
  37. alsomitra

    alsomitra

    Joined:
    Aug 31, 2017
    Posts:
    33
    Hey,
    Sorry for the late reply.
    thank you for the advice.
    I will check.
     
  38. Milionario

    Milionario

    Joined:
    Feb 21, 2014
    Posts:
    138
    How can I make a puppet with stagger behaviour to mantain his forearm always pointing up?

    For example this is the pose I put him initially:


    But if he falls I want to MANTAIN the forearm pointing up(world Vector3.up), it points to where I left the pose which is normal I guess:


    I tried freezing the rotation on Y and Z, it works but then the staggering is somewhat 'supported' because of it and less natural, any other alternative?
     
  39. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,548
    Hey,
    It will stagger in the direction in which it is falling. So could try adding force to for example the spine rigidbody in the direction you want to push him.

    Hey,
    Please try this script:

    Code (CSharp):
    1. public PuppetMaster puppetMaster;
    2.  
    3.     private Muscle chestMuscle;
    4.     private Transform rightUpperArm;
    5.     private Transform rightForearm;
    6.     private Transform rightShoulder;
    7.     private Vector3 rightShoulderAxis;
    8.     private Vector3 rightUpperArmAxis;
    9.  
    10.     private void Start()
    11.     {
    12.         // Cache bones and muscles
    13.         chestMuscle = puppetMaster.muscles[puppetMaster.GetMuscleIndex(HumanBodyBones.Chest)];
    14.         rightUpperArm = puppetMaster.targetAnimator.GetBoneTransform(HumanBodyBones.RightUpperArm);
    15.         rightForearm = puppetMaster.targetAnimator.GetBoneTransform(HumanBodyBones.RightLowerArm);
    16.         rightShoulder = puppetMaster.targetAnimator.GetBoneTransform(HumanBodyBones.RightShoulder);
    17.  
    18.         // Get axes from shoulder and upper arm towards their next bones
    19.         rightShoulderAxis = Quaternion.Inverse(rightShoulder.rotation) * (rightUpperArm.position - rightShoulder.position);
    20.         rightUpperArmAxis = Quaternion.Inverse(rightUpperArm.rotation) * (rightForearm.position - rightUpperArm.position);
    21.  
    22.         // Register to get a call from PM each time before it reads the pose
    23.         puppetMaster.OnRead += OnPuppetMasterRead;
    24.     }
    25.  
    26.     void OnPuppetMasterRead()
    27.     {
    28.         // World space target direction
    29.         Vector3 worldDir = Vector3.up;
    30.  
    31.         // Convert world space to chest muscle space
    32.         Vector3 dir = chestMuscle.target.rotation * (Quaternion.Inverse(chestMuscle.transform.rotation) * worldDir);
    33.  
    34.         // Rotate shoulder and upper arm
    35.         rightShoulder.rotation = Quaternion.Slerp(Quaternion.identity, Quaternion.FromToRotation(rightShoulder.rotation * rightShoulderAxis, dir), 0.5f) * rightShoulder.rotation;
    36.         rightUpperArm.rotation = Quaternion.FromToRotation(rightUpperArm.rotation * rightUpperArmAxis, dir) * rightUpperArm.rotation;
    37.     }
    Best,
    Pärtel
     
  40. Milionario

    Milionario

    Joined:
    Feb 21, 2014
    Posts:
    138
    Hi Partel tahnks for your reply, in the first question I actually meant something a little different, at the moment I am adding forces to the character spine so it staggers in a direction but his 'rotation' stays the same, the LookAtIK only works with a head bone(obviously), I would like to make it twist around or atleast try to look at the direction it is moving, is that possible?

    And regarding the second script I am gonna try it out, does it need to derive from a specific class? Thank you!

    By the way I sent you a PM about something I found which I don't know if it was intended to work like that or not.
     
    Last edited: Mar 20, 2020
  41. NewMagic-Studio

    NewMagic-Studio

    Joined:
    Feb 25, 2015
    Posts:
    454
    I contacted you to your email many days ago and dont reply. I am using old prop system and my weapon props go through colliders, they dont work anymore, maybe the update made old system not work anymore? though the old scripts are still in the package. And the new system gives me errors, so doesnt work either, though in the examples scenes doesnt give any error. I am using it with vrik
    Prop colliders dont go through , just the mesh render of the model goes through
     
    Last edited: Mar 22, 2020
  42. NewMagic-Studio

    NewMagic-Studio

    Joined:
    Feb 25, 2015
    Posts:
    454
    Got to solve it, it was cause i had Muscle mapping weight to 0
     
  43. NewMagic-Studio

    NewMagic-Studio

    Joined:
    Feb 25, 2015
    Posts:
    454
    Now i got a problem i didnt have for some time, hands go up and sometimes i cant move it, maybe that is why i had Muscle mapping weight to 0, you can see it in the shadows the character make, left hand is up and i cant move it, and right hand just bends with elbow. I attach you the video in mail i sent you.
     
  44. Kagyu

    Kagyu

    Joined:
    Mar 5, 2016
    Posts:
    95
    Hi Partel,
    I like to change the siblings index of PuppetMaster transform after making my model to a puppet.
    For now I do not see any problem by changing the order of children but I would like to make sure this changing does not cause any issue in the future.
    Do you think changing siblings index is ok for the PuppetMaster plugin? PuppetMasterForumQuestion20200324.jpg
     
  45. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,548
    Hey,
    If you have spine bones assigned to LookAtIK, it should also rotate the spine. But you could just add rotation offset to the spine bones in LateUpdate or from PuppetMaster.OnRead to turn them left/right, like this:

    Code (CSharp):
    1. public Vector3 spineOffset;
    2.  
    3. void Start() {
    4. puppetMaster.OnRead += OnPuppetMasterRead;
    5. }
    6.  
    7. void OnPuppetMasterRead() {
    8. spine.localRotation *= Quaternion.Euler(spineOffset);
    9. }
    That script doesn't have to derive from anything other than MonoBehaviour.

    Hey,
    Just replied to your email.

    Hey,
    That is not a problem, don't worry about it.

    Best,
    Pärtel
     
  46. Deckard_89

    Deckard_89

    Joined:
    Feb 4, 2016
    Posts:
    315
    Is there a reason why the Puppet's Spine's Box Collider is disabled when play mode starts? As far as I know it is the only bone that has it's collider disabled on play.
     
  47. peeka

    peeka

    Joined:
    Dec 3, 2014
    Posts:
    113
    I wish puppetmaster and final ik has assembly definition files..
     
  48. Pixel2015

    Pixel2015

    Joined:
    Mar 10, 2016
    Posts:
    35
    Hi, in all my imported characters I get this issue, any ideas how to fix this? The skeleton on the character is ok, all the animations play as they should just puppetmaster generates like this and obviously then doesn't work as intended.

    Thanls.

     
  49. MetalDonut

    MetalDonut

    Joined:
    Feb 7, 2016
    Posts:
    127
    Hi All - I'm sure this is a common challenge but looking for best practice....

    The puppetmaster and model (+animator) gameobjects are parented to a 'root' gameobject which is itself a child of a parent game object that has my character controller on. When the character gets hit and falls I initiate Puppet Master's ragdoll which naturally falls away and out of position from it's parent. As the character will get up in place, I then need to move the parent gameobject to the new location of the model and put all of the children back under it in their original offset positions.

    I tried unparenting the root and then moving the parent gameobject to the new position and then re-parenting but I'm not having success. Is there a method or best practice on how to do this?? Thanks!
     
  50. michealcaj

    michealcaj

    Joined:
    Aug 18, 2017
    Posts:
    191
    one question boss, can I use this tool to Create animation directly in unity3d instead of importing From another 3d software like blender or Maya