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. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,548
    Hi,
    Thanks for all the feedback, I'll certainly keep that in mind when I make changes in the future.

    When you set continuous collision, did you set the bat to Continuous Dynamic and also the ball to Continuous? Just making sure, because its not obvious and many devs don't know they have to do the latter to make it work.
     
  2. Fera_KM

    Fera_KM

    Joined:
    Nov 7, 2013
    Posts:
    307
    Hi, thanks for checking up.

    Actually yes, the ball is continuous dynamic and the club is Continuous, (maybe better to reverse it, since the user input is driving the club??). I think unity, in general, is very badly documented in regards to physics. At least for people like me, that needs it spoon fed...
     
  3. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,548
    Hey, yea, it might be worth it to try to reverse it, not sure though..
     
  4. kinodax

    kinodax

    Joined:
    Dec 3, 2014
    Posts:
    22
    How would you update the physics/ragdoll hierarchy to match changes in resizing the bones of the visible hierarchy? I am trying to get PM to work with Morph3D and everything is working, except when I morph a character, the physics/ragdoll hierarchy doesn't follow, so things like the shin bones remain too long and the character ends up floating. Is there a magic button to update the ragdoll bones to the new resized visible bones? I could resize the relevant colliders myself if their were. Or is there a better way to look at the problem?
     
  5. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,548
    Hi, do you have "Update Joint Anchors" enabled in PM?

    If you have like a character customization scene, then you could set up PuppetMaster in runtime when changes have been made and you proceed to play. See the "Create Puppets In Runtime" demo scene.
    If you can't do that, let me know, I'll figure something out.

    Cheers,
    Pärtel
     
  6. kriket

    kriket

    Joined:
    Aug 28, 2014
    Posts:
    33
    How can one reduce the rebound time. For Example: if i hit a puppet on it head, it rebounds back very quickly. How can I slow this rebound down a bit. So it takes 2-3 seconds to rebound instead of instant rebound.
     
  7. kinodax

    kinodax

    Joined:
    Dec 3, 2014
    Posts:
    22
    I do have "Update Joint Anchors" enabled. I traced through the demo scene and the update joint anchors code. I saw a todo comment related to update joint anchors about needing to be in late update, so I gave that a try, but it was not a solution. I then hit the "Support Translation Animation" flag, and Success!! at least with the matching hierarchy problem. I still have to fix my dynamic collider resize problem, but that's my problem and much easier when the skeletons match up. I believe the Morph3d mesh is generated dynamically by their DLL so it probably behaves like translation animation from your code's perspective.

    Anyway, solution: Morph3d --> "Support Translation Animation" = true

    Thanks!
     
  8. ez06

    ez06

    Joined:
    Feb 18, 2014
    Posts:
    45
    Hi there,

    When I use SetState(BehaviourPuppet.State.Unpinned) on a character which has a Character Controller, the character unpins and stays in the air. It doesn't hit the ground when unpinned.
    The problem disappears when I remove the Character Controller altogether.

    How can I fix that problem?
     
  9. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,548
    Mostly by reducing "Regain Pin Speed" in BehaviourPuppet, but also increasing "Muscle Damper", increasing "Pin Distance Falloff", decreasing "Muscle Spring". All those params have an effect on the rebound time.

    It is also possible to dynamically adjust variables based on how "damaged" muscles are:

    Code (CSharp):
    1. public BehaviourPuppet puppet;
    2.  
    3.     void FixedUpdate() {
    4.         foreach (Muscle m in puppet.puppetMaster.muscles) {
    5.             // When a muscle collides with something, it's state.pinWeightMlp is temporarily reduced.
    6.             float muscleDam = (1f - m.state.pinWeightMlp);
    7.  
    8.             // We can use that information to dynamically adjust some variables, for instance...
    9.             // increase muscle dampering while it is less pinned...
    10.             m.state.muscleDamperAdd = muscleDam * 500f;
    11.  
    12.             // and/or decrease muscle weight while it is less pinned
    13.             m.state.muscleWeightMlp = m.state.pinWeightMlp * m.state.pinWeightMlp;
    14.         }
    15.     }
    A rebound of 2-3 seconds would be very difficult to achieve though, as the puppet will likely just fall over. It might also not look very realistic as the pin forces holding the puppet up are not natural forces. You might want to consider combining it with a rebound animation.

    Oh, great! Didn't even think about that for some reason.

    Hi!

    What exactly do you mean by stays in the air... like an astronaut floating around?
    Could you PM me a video or something please?

    Cheers,
    Pärtel
     
  10. locust99999

    locust99999

    Joined:
    Sep 28, 2015
    Posts:
    2
    Hi Partel!

    We are using puppetmaster and really like it thus far but I definitely would love to see what a "good" set of values for a human biped looks like in terms of joint constraints and limits/locks. Could you post/link settings you think are acceptable for all the related links? Currently what we have is not behaving acceptably. Thanks!
     
  11. ez06

    ez06

    Joined:
    Feb 18, 2014
    Posts:
    45
    Please see image attached. When the "Fall" animation is triggered, the character stays static in the air because the capsule collider under him is preventing him from falling to the ground.

    Have you encountered that problem before?


    I have another problem: when I use this:
    myPuppetBehaviour.SetState(BehaviourPuppet.State.Unpinned);
    myPuppetBehaviour.onLoseBalance.animations[0].animationState="Fall2";

    The character falls with the new animation, as expected, but sometimes the GetUp animation is not triggered after the Fall2 animation. Most of the time it is, but for some reason, not always.

    Is there something I have to do to make sure it works?
     

    Attached Files:

    Last edited: Jul 20, 2016
  12. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,548
    Hi and thanks!

    Drag a Dummy to a scene, add the BipedRagdollCreator and use it to create a ragdoll, click on "Start Editing Manually" and switch Edit Mode to "Joints" in the Scene View toolbox. Then you can click on each joint and see the joint limits visualized. That's what I have defaulted the limits to. It might be that BipedRagdollCreator has failed to recognize bone orientations for your specific character, so its always good to click on those joints and see if the limits look logical.

    But it really depends also on the range of motion in your animation clips. If you see an arm not working right when "Angular Limits" are enabled, you'll need to loosen the limits. Or not use "Angular Limits" at all while the puppet is pinned, the muscles and pins normally maintain the motion within the limits anyway.

    Hey,
    No I have not seen that before. But the second problem might be connected to the first problem, meaning the puppet will get up without triggering the get up animation and be stuck pinned in the falling animation like in your screenshot.
    I'm thinking maybe the puppet gets up while Mecanim is still cross-fading to the Fall animation and the crossfade call to the GetUp state is ignored by Mecanim. See if reducing Crossfade Time in the OnLoseBalance event helps. Let me know if it does, I'll need to add some code that protects from this kind of stuff then.

    Cheers,
    Pärtel
     
  13. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    Has PuppetMaster been tested with Opsive's Third Person Controller? Does anyone know if they behave well together?
     
  14. chaneya

    chaneya

    Joined:
    Jan 12, 2010
    Posts:
    416
    Funny you should ask. Just today I started playing around with this. It turns out Opsive has a Integration package for both Final IK and Puppet Master that you can download from Opsive's website if you have your invoice numbers for Third Person Controller. Additionally Partel has made a 2 part Youtube series on integrating with Opsives Third Person Controller and the Unity Controller.

    Both Integration packages includes sample scenes with a functioning character for Final IK and Puppet Master.

    Allan
     
    Tinjaw and Partel-Lang like this.
  15. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    Thanks. I have FinalIK and I knew about that integration. I should have thought to look for PuppetMaster as well.
     
  16. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,548
    Hey,
    Look at the "Plugins/RootMotion/PuppetMaster/_Integration" folder, there is a package for Opsive's among other things.

    Cheers,
    Pärtel
     
  17. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Hey Partel, there's a link to Puppetmaster integration for Opsives TPC but no package. I came here for this issue in fact so this was quite timely I guess. While I haven't checked your method recently i've tried using Opsive's own integration package for Puppetmaster and there's an odd issue with jumping where an animation event seems to be delayed when Puppetmaster is enabled, not when not. Do you have anything to suggest? Opsive could only suggest asking you
     
  18. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,548
    Hey,
    I'm not that familiar with Opsive to know what might be delaying the animation event. Could you make me a repro project or something?
     
  19. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Hey we figured it out in the end, it was an animation event that started at 0 in the timeline and for some reason when Puppetmaster was enabled it wouldn't trigger the animation event. It was fixed by moving the event a little later in the animation timeline. Opsive are going to put the fix in the integration so it shouldn't be a trouble
     
  20. Der_Kevin

    Der_Kevin

    Joined:
    Jan 2, 2013
    Posts:
    517
    howdyho!
    iam currently trying to merge the aim ik (finalik puppetmaster integration) demo with the melee demo. so actually giving the melee character a weapon in his hand instead a stick. so what i did so far is:

    - set up 2 aim ik's (Aim Gun and Aim Head - just like in the AimIK Demo)

    - put a "IK before physics" component where the animation controller is in

    - set up the Aim IK Demo so that it fits to the new stuff and linked everything correct

    - copy paste the aiming upperbody action/blendtree from the "Humanoid Aiming System.controller" (aimik demo) to the "Humanoid third person puppet.controller" (melee demo) and set it as default state in the upperbody acions.
    aimik3.gif
    and the result is this:
    aimik2.gif


    did i missed anything?
     
  21. Partel-Lang

    Partel-Lang

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

    I'm not sure what went wrong, I tried it and it seems to work.
    Here's a package with AimIK set up in the Melee demo.

    This is what I did:

    1. Went to the AimIK demo, copied the Aim Targets and the Pilot, pasted them to the Melee scene.
    2. Moved over the AimIK components from the copied Pilot to the one in the scene, replaced all bone references in them, set weights to 1.
    3. Copied over the IKBeforePhysics script, replaced the PuppetMaster reference in that.
    4. Duplicated the HumanoidThirdPersonPuppet controller, added the aiming blend tree to that, set "Aim Forward" param to 1.

    Maybe you had some additional scripts running on that character, try disabling those to see if they mess anything up.

    Cheers,
    Pärtel
     
    Der_Kevin likes this.
  22. punkouter2019

    punkouter2019

    Joined:
    Jul 28, 2013
    Posts:
    170
    Simple question. Will there ever be behaviours that are more than just moving the joints to certain locations or animations ?

    A simple example would be 'Standing' where the character is forced to balance ? Or is this too complex? I know you can fake balance now ..
     
    looki666 likes this.
  23. looki666

    looki666

    Joined:
    Sep 5, 2013
    Posts:
    79
    Fully dynamic Balance and Regain Balance would be killer Feature :)
     
  24. punkouter2019

    punkouter2019

    Joined:
    Jul 28, 2013
    Posts:
    170
    I feel that may be far more complex than how it works now. So for now just unpinning muscles and attempting to move to a pose looks good enough. but maintaining balance for REAL is the ultimate goal ive been waiting for someone besides natural maotion to put out there
     
    looki666 likes this.
  25. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,548
    Hi, sorry for the long wait, been neck-deep in physics papers ;)

    You mean something like this?
    Its the latest thing I'm working on.. Currently PM has a balance behaviour in the Final-IK integration package, but it sucks in many ways. This one uses an inverse pendulum sort of thing, for now the character is being balance just by adjusting the ankle joint targets. I'll add more controller options for that in the future.. But it even with just the ankles it seems to work quite nicely. Can handle a bit of animation too if its not too violent, switching between crouching and stuff like that.

    Cheers,
    Pärtel
     
  26. DMeville

    DMeville

    Joined:
    May 5, 2013
    Posts:
    418
    Hey Partel,

    I'm trying to set up Bolt networking in my game. Previously all ragdolling and everything worked great. I would instantiate my character prefabs (with puppetmaster) at the start of the game, everything was good.

    However, when switching out Instantiate for Bolt's Networked Instantiate I'm getting this warning now, and the ragdoll just falls on the floor. http://i.imgur.com/eNVUg2j.png

    I'm not moving the position, so it must be something internal with Bolt's networked instantiate, but is there any way around this you can think of? Like some way to "reset" the ragdoll state so it's connected and set up properly or something?

    I can change the call before the warning is thrown to something like this, seems to work. Probably breaks other stuff though, seems way to hacky.

    Code (CSharp):
    1.     if (targetRoot.position != transform.position) {
    2.       targetRoot.position = transform.position; //added this
    3.       if (log) Debug.LogWarning("The position of the animated character (Target) must match with the position of the PuppetMaster when initiating PuppetMaster. If you are creating the Puppet in runtime, make sure you don't move the Target to another position immediatelly after instantiation. Move the Root Transform instead.");
    4.        //return false; //commented this out
    5.     }
     
    Last edited: Aug 5, 2016
  27. MICKDOii

    MICKDOii

    Joined:
    Jan 12, 2015
    Posts:
    69
    Hey I'm having an issue with setting up a character.
    A few questions first.
    1: Does it matter if I've used mixamo to rigged my character.
    2: Does it matter that my fbx when imported is x10 larger then the fbx puppet for example.
    3: does scaling that down to the same height as the puppet or pilot have a negative effect at all.

    The issue I'm having is that once I setup the ragdoll with Biped ragdoll editor and replace the pilot prefab with my own it all seems to work fine apart from the fact when i walk or run the character moves x10 faster and almost looks like the animations are at the right speed but the character controller is moving as if the character controller is x10 more that the actually model and animation.



    One last thing is that when I'm just using the puppet with the User AI Control, if I have one puppet in my scene without anything but ground I have roughly 1000fps, but as soon as I add 5 or more it my fps drop to like 15fps.
    any ideas on why this is happening and how I can optimize this so i can have a very large amount of puppets?

    any help would be very appreciated.
    Thank you.





    EDIT:



    Fix the issue with not being able to set it up right.
    It was due to the fact I was scaling down the fbx then setting it all up.
    In future don't scale it down till you have set it all up.

    the only issue now is that i can't have many in a scene with losing 800+ FPS.

    is there anyway around this at all?
     
    Last edited: Aug 5, 2016
  28. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,548
    Hi,
    Something must be moving the PuppetMaster gameobject or the target character's gameobject before PuppetMaster initiates. If you can't figure out what it is, you can use the fix you posted, it will not break anything. I would have added a line like that myself, but such things can create problems for other people when they don't understand what offset their rig.

    Hi, have you tried the stuff in the Performance page of the user manual?

    Cheers,
    Pärtel
     
    DMeville likes this.
  29. MICKDOii

    MICKDOii

    Joined:
    Jan 12, 2015
    Posts:
    69

    Thanks for the quick reply.
    Yes I have but even when doing those things it's only a small change in fps.
    Even with 16gig ram and a GTX 980 I'm under the impression that it's just not possible to have anymore the 10-20 ragdolls and probably worse when they're colliding.
     
  30. punkouter2019

    punkouter2019

    Joined:
    Jul 28, 2013
    Posts:
    170
    So just ankle joints is good but true balancing would require the biped to life his feet to compensate for falling to one side right?

    For me and many people this is the next big thing. I see research papers on It a lot and there was endorphin (what happened to that?) but my guess is it is very complicated so few people out there can do it.. There is nothing else around that is attempting to do what you do as far as Unity plugins right?

    I think the research paper videos were using neural network to train right? But since this is real time the biped behaviors are not from training right? Or can you someone train a behavior and then put that code into the biped... I think this is how the Kinect works with detecting limbs.


     
  31. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,548
    Its more CPU-bound so a lot of ram and a good GPU will not really help. But yes, I would not recommend more than 20 ragdolls. Although this guy has managed a lot more somehow.

    Yes, lifting a foot could be added on top of it, that would be a controller for the thigh muscles. Then another for the spine and the arms, will be working on that...

    There are papers about it and it has been done, but never in a way that you could use right out of the box like an Asset Store tool. Stuff like that usually takes a lot of tweaking to get right, but that depends on the specifics of each character and what exactly needs to be done. That's why Euphoria was not sold as a tool, but a service (one that only the biggest AAA studios could afford), requiring users to employ people from NM to help them set things up. That's probably also the reason why it was scrapped from GTA5. So automation is really the key here. Neural nets could be used to train controllers, but I could not expect all Asset Store users to learn how to do that for each weird character rig out there.

    About Endorphin, it was a tool for the animators, it had a very high-definition humanoid model, say something like 8 colliders per foot to calculate exact pressure and stuff like that. It was top quality, but could not even run a single instance in real-time, had to be baked.

    Cheers,
    Pärtel
     
  32. Der_Kevin

    Der_Kevin

    Joined:
    Jan 2, 2013
    Posts:
    517
    yeah, it was really made with a killer pc. also the screen capture software i used was helping a lot there. the framerate sometimes droped pretty heavy. last thing was using physics record (https://www.assetstore.unity3d.com/en/#!/content/27775)

    so, its more a fun rendering then something that can be used in a game. i think if you optimize a lot(your model and using less bones) you can get around 32 puppets on a decent pc. sorry to destroy the illusion ;)
     
    LudiKha and Partel-Lang like this.
  33. MICKDOii

    MICKDOii

    Joined:
    Jan 12, 2015
    Posts:
    69
    Haha hopes were high.
    Yeah I manage to optimize it as much as possible before it just started getting clunky and even still not much of a budge.
    Plus we can not expect consumers to have a great rig.

    oh well we can only dream for the moment.

    Thanks for the reply man and good luck with Footbrawl.
     
    Der_Kevin likes this.
  34. punkouter2019

    punkouter2019

    Joined:
    Jul 28, 2013
    Posts:
    170
    I see. Can you dumb it down and make it useable ? Perhaps create some restrictions.. a standard biped size since I imagine it is hard to get to work with just any biped
     
  35. Der_Kevin

    Der_Kevin

    Joined:
    Jan 2, 2013
    Posts:
    517
    thanks! that helped a lot. dont really know what went wrong in my version but yeah. it works now :D



    next thing i would like to know: how can i set up different animations for different props?
    the stick is pro type 0 and the m4-gun prop type 1. but now the character is using the aiming animation while carying the stick
     
    Last edited: Aug 10, 2016
  36. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,548
    Yes, I'm quite sure I'll be able to come up with a solution.
    I've been working on Stagger for the last few days. A short video of the progress so far, it is still missing Catch Fall and some other stuff.

    Hey,
    You can add states to layer 1 in the animator controller, that is upper-body actions, if that was what you meant.

    Cheers,
    Pärtel
     
    majorgrubert, looki666 and LudiKha like this.
  37. LudiKha

    LudiKha

    Joined:
    Feb 15, 2014
    Posts:
    140
    That staggering looks fantastic! Looking forward to its release. Is it a separate behaviour?

    Question about quadrupeds: my horse setup is rather unstable - it has a tendency of falling down at the slightest touch (with resistances etc cranked up) and the animation is quite wobbly. Any idea what could cause this?

    Edit: On another note, the follow line of code breaks the setup if the cloth colliders are null (line 290 in PuppetMasterSetup.cs):

    Code (CSharp):
    1. if (c.gameObject == collider.gameObject) return true;
    Should probably check if the collider exists
     
    Last edited: Aug 11, 2016
    one_one likes this.
  38. one_one

    one_one

    Joined:
    May 20, 2013
    Posts:
    621
    Pretty impressive stuff, how does the character trying to rebalance work? Is it mostly animations (like spreading out the arms) or is it actively trying to balance by moving body parts in a way that would rebalance its center of mass?
     
  39. Der_Kevin

    Der_Kevin

    Joined:
    Jan 2, 2013
    Posts:
    517
    hey, thanks.
    but how do i call or set up the states based on the prop? so that i have the aiming animation for prop type 1(the m4) and the normal run animation for the prop 0 (the stick)
     
  40. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,548
    Hey, thanks! It will probably be a separate behaviour, just as BehaviourFall, so you can use BehaviourPuppet and then switch to that if the balance is lost.

    Can you send me that horse setup? I'll take a look. Did you try increasing Muscle Spring?

    Hey, no animations other than the idle animation playing on that character. Balancing currently works by adjusting the ankle joints to balance the center of mass. No cheating there, no invisible external forces at play. The arm behaviour is procedural too, basically just simple windmill function for now.

    In CharacterMeleeDemo component that is on the Character Controller gameobject, on the bottom there are Actions. Screen Shot 2016-08-12 at 09.44.15.png

    That you can use to call animations on the upper-body layer and set Required Prop Types to what you need.
    But that layer weight will be faded in only for the duration of the animation, so if you need a constant pose, you should add a new upper-body mask layer between 0 and 1. Add a blend tree that blends between different upper-body poses and a parameter for it (let's call it PropType). Then add some code to CharacterAnimationMeleeDemo.cs that sets that parameter, like
    Code (CSharp):
    1. animator.SetFloat("PropType", melee.propRoot.currentProp.propType);
    2.  
    3.            
    Cheers,
    Pärtel
     
    Der_Kevin and one_one like this.
  41. LudiKha

    LudiKha

    Joined:
    Feb 15, 2014
    Posts:
    140
    Disregard the horse issue - it was probably related to the skeleton. Did another setup with a different skeleton and that is very stable now. Cheers!
     
  42. punkouter2019

    punkouter2019

    Joined:
    Jul 28, 2013
    Posts:
    170
    All I can think of is how all this will lead to the ultimate fighting game... A very rough attempt was made at this years ago with

    http://www.gravitysensation.com/sumotori/

    But it is basically unplayable. With your behaviors it seems very possible. So far games have been a hybrid of canned animations with ragdoll/physics behaviors. But I am interested who will come out with the first playable 100% physics based fighting game. To do that you would need to teach a biped to move forward without falling which is a behavior I don't think you have and maybe is too complex? The rest is pretty much already there .. punching is no big deal... you have balance.. and falling is easy

    I see this is the direction we are going and canned animations wont exist in 20 years
     
  43. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,548
    Hey,
    I think you might be just a little bit too optimistic there... The way we behave is not down to just our physical capabilities, bones, joints and muscles. It also has a lot to do with psychology, past experience, intelligence and training. Sometimes you can even tell a few things about someone's personality just by observing his/her gait, that is how big the role of mentality is in our physical behaviour. That is also why I very much doubt we will be able to simulate it without simulating the entirety of human nature. But a game like Sumotori is another thing of course :)
     
    majorgrubert likes this.
  44. Der_Kevin

    Der_Kevin

    Joined:
    Jan 2, 2013
    Posts:
    517
    awesome! thanks! iam almost there i think.
    i havent changed the CharacterAnimationMeleeDemo based on your approach since i realized that it feels better if you only aim when you press the aim button which is a melee action and set up like this:
    aiming.gif

    the only problem iam facing now is, this:
    aiming_bug.gif
    so in this image i am holding down the "Hit Key" all the time - from the "User Control Third Person" script and the aiming blend tree animation gets looped.

    all i wanna do now is, hold down the aim/hit key - character aims and then when i release it, he stops aiming. how could i do this? thanks!
     
  45. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,548
    Hey, its not actually the animation looping, its the upper-body layer weight being blended in/out by CharacterAnimationMeleeDemo.cs. You can change that if you comment out private IEnumerator FadeLayerWeight()
    in that script and the line that starts it and make a transition from all states in the UpperBody Actions layer back to the Empty state (Unity will give you an error message about transitioning to an empty state, which you can ignore, seems to work now).
    Then a solution would be to make that Empty state a blend tree and blend between empty and the aiming pose.
     
    Der_Kevin likes this.
  46. R_matey

    R_matey

    Joined:
    Jul 10, 2015
    Posts:
    1
    Hi, I am having an issue with swapping in my own model to replace your default third person controller. I can do this and it works perfectly with the normal version, but trying to switch it to interpolate because I want to use the slow mo. The rag doll does engage but flickers at the end of the appendages it flaps rapidly each frame. Am I missing something with setting up the interpolate , or do I need to make sure the hierarchy for the ragdoll needs to be flat? thanks

    ---Edit: Looks like flattening the hierarchy did fix my issue, did not see this mentioned in your help comments in Unity.

    --Another note: Needing to set Smooth Physics on the character puppet to make animations run smoothly in interpolate mode, was also not noted in the help comments.
     
    Last edited: Aug 17, 2016
  47. polycular

    polycular

    Joined:
    Oct 8, 2014
    Posts:
    17
    Hi, regarding the 2,5d sample/demo I just found a unitypackage but in 5.4.0p1 it doesn't open that package.
    Should that package be the sample? What to expect from 2,5d I would interested in 2D ragdolls would that be feasible or not with the sample?
     
  48. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,548
    Hey, thanks I'll add those comments.
    Yes, the interpolation works best if it's flat and all rigidbodies have interpolation enabled. If it's a tree structure and all have interpolation, those interpolations might "fight" each other, or if only the pelvis has it, the general motion of the puppet will be smooth, but the motion of the limbs relative to the pelvis will not be smooth.

    Hey, just checked, seems to work alright in 5.4.
    The goblin assets will import to "Assets/Goblin Archer", not the _Interactions folder. Open the scene, look at the comments on the _READ ME! gameobject. There is a link to a free asset store package that must be imported that contains the 2D goblin. It is not included in PM for copyright reasons. So import that too and the scene should work nicely. 2.5D in that context means the puppet is 2D, but set up with 3D physics components as PM does not yet support 2D joints.

    Best,
    Pärtel
     
  49. chaneya

    chaneya

    Joined:
    Jan 12, 2010
    Posts:
    416
    Partel

    I'm using EffectorOffset in combination with FBBIK and Puppet Master. I have 2 questions about EffectorOffset.cs.

    1. Can EffectorOffset.cs be modified to offset both position and rotation? If not, what is the best way to apply rotation offsets in addition to the position offsets used in EffectorOffset.cs? My preference would be to add rotation vector3 offsets in EffectorOffset.cs so I can weigh in rotational changes at the same time I am weighing in positional offsets. I considered using LimbIK components but those appear to require a target and I'm not working with targets. I'm just altering animations during runtime for different purposes.

    2. Is there anyway to add Left Forearm and Right Forearm to the EffectorOffset.cs code? There are references to Fore Arms in FBBIK but for some reason they are not available when I look at ik.solver in EffectorOffset.cs. Perhaps if I could get the rotation offsets, I might not need the Forearms but in the absence of rotation, I'm having trouble achieving certain poses/animation adjustments.

    Thanks
    Allan
     
  50. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,548
    Hi,
    I can't really add rotation offsets to FBBIK, its just a limitation of the solver, it works in position space.
    But you can add rotation offset to the hand bones for example just by rotating them in LateUpdate and set "Maintain Hand Rot" to 1 in the FBBIK inspector. You might also be interested in taking a look at the "Offset Effector" demo scene (not to confuse with "Effector Offset"), that demoes a script that uses effector position offsets to mimic rotation offset.

    The only control available for the forearms is the bend goals. You can access forearm bend direction via code:
    Code (CSharp):
    1. ik.solver.leftArmChain.bendConstraint.direction = something;
    2.             ik.solver.leftArmChain.bendConstraint.weight = somethingElse;
    3.