Search Unity

  1. Get all the Unite Berlin 2018 news on the blog.
    Dismiss Notice
  2. Unity 2018.2 has arrived! Read about it here.
    Dismiss Notice
  3. We're looking for your feedback on the platforms you use and how you use them. Let us know!
    Dismiss Notice
  4. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Learn more.
    Dismiss Notice
  6. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  7. Magic Leap’s Lumin SDK Technical Preview for Unity lets you get started creating content for Magic Leap One™. Find more information on our blog!
    Dismiss Notice
  8. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

PuppetMaster - Advanced Character Physics Tool [RELEASED]

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

  1. RakNet

    RakNet

    Joined:
    Oct 9, 2013
    Posts:
    84
  2. MostHated

    MostHated

    Joined:
    Nov 29, 2015
    Posts:
    507
    ----- I fixed this part
    I will check Fix Target Transforms when I get home from work, but I believe the answer is yes to that question. As for the capsule, it was connected to my player object within the player hierarchy that was generated by PM (so just my actual player, not the puppet as well). I think it was my original player collider from before I applied PM. I tried to move it a little and my player just fell. Does my actual player still need the same collider that I was using before applying PM? I think it just became shrunk down after adding PM for some reason. I also think it might be contributing to the crazy jittering as well. I will have to check that also.

    ---- I fixed this part as well
    Should I just be using a normal capsule collider when using PM with Opsive TPC? Should it be right even with the ground? Should I be using some other sort of collider setup?

    -----Fixed this as well
    For some reason, when the collider was tiny on the ground, the puppet was staying with me just fine, now that I made the collider the size it should be on my actual player the puppet is falling through the ground again. I did the "fix muscles" thing 3 times, yet I keep getting the warning each time in the console.

    ---- Edit Good lord, I finally got everything working right on my character as far as being able to move, and having him fall over and what not. For some reason everything under the sun that could possibly be wrongly configured from the automatic setup, was. Then again, that seems to happen quite often.
    ----------------- an ----------------------------------------------------------
    These two I still need help with

    I still have the issue with him eventually starting to jitter up and down really bad like he is having a convulsion, but it starts really slow now and ramps up, it takes a few minutes for it to get bad. A few of the settings are set to Fix Transform, should they not be? My NPC does not do this for some reason, but my character does.

    Also, any idea why Inventory Pro would be having an issue spawning my character? I have it parented and prefabed as it should, in the Spawner I added the parent/prefab, but for some reason when it spawns me,it moves the whole prefab to the spawn point, but the puppet stays there and then falls over, then falls through the ground. If I place my character right on the spawn point and then start it, it will stay and everything is fine, but for whatever reason spawning the prefab, the puppet won't follow.

    Searching back through some of the posts I saw some about pooling the character, would that be a better way to go about it? I tested it out a bit by just adding a pool and the respawning script to my scene and I was able to spawn over and over and everything seemed to stay in place (though initial spawn was still directly on the spawn point, I will test it more tomorrow) but for some reason the Y axis of the puppet object just constantly kept falling even though everything seemed to be fine, I was able to unpin and fall over and then go back. If I put myself in the pool it would stop falling, then I spawned again and it would start to fall again from the same position but I have no idea what it was that was falling.
     
    Last edited: Feb 8, 2018
  3. internethip

    internethip

    Joined:
    Oct 21, 2013
    Posts:
    20
    @Partel-Lang Thx, Teleport() worked a lot better! Had issues with the ragdoll colliding with stuff during the move using transform.position = position;
     
  4. bumd

    bumd

    Joined:
    Aug 20, 2017
    Posts:
    6
    Hello, I sent you the project.

    Looking forward for your findings. I also found something, in unity 2017.2, physics and transform update structure has been changed that I read from here, maybe it is relevant to this problem:

    https://docs.google.com/document/d/1jQzTzJGSQSIcwi7WiP-Ot5mW6N0xqmgKQRGdjbadTM8/edit

    https://forum.unity.com/threads/preview-of-2017-2-features.481949/
    and this
    https://forum.unity.com/threads/2017-2-physics-broken.499886/

    also pushing real low value for fixed timestep as like 0.002, ragdolls are not flying into space anymore when I hit it with the prop, but still not behaving %100 correct to physics forces, they still make unnatural movements and making arc movements on air.
     
    Last edited: Feb 6, 2018
  5. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,677
    Hey,
    I managed to reproduce the issue with the InteractionSystem and picking up. Try enabling "Pick Up" for the event that picks up the prop. That will use the picked up position/rotation as a point to start fading back from, otherwise the hand will start to chase itself around trying to follow a target that is parented to the hand.

    About your bugfix, thanks, it's a good point!
    I wrote the fix like this, avoiding the slow GetComponentsInChildren:

    Code (CSharp):
    1. // Enable collisions between the new muscles and the removed colliders
    2.             if (!internalCollisionsEnabled) {
    3.                 foreach (Muscle newMuscle in newMuscles) {
    4.                     foreach (Collider newMuscleCollider in newMuscle.colliders) {
    5.                         foreach (Collider removedMuscleCollider in muscles[index].colliders) {
    6.                             Physics.IgnoreCollision(newMuscleCollider, removedMuscleCollider, false);
    7.                         }
    8.  
    9.                         for (int childMuscleIndex = 0; childMuscleIndex < muscles[index].childIndexes.Length; childMuscleIndex++) {
    10.                             foreach (Collider childMuscleCollider in muscles[childMuscleIndex].colliders) {
    11.                                 Physics.IgnoreCollision(newMuscleCollider, childMuscleCollider, false);
    12.                             }
    13.                         }
    14.                     }
    15.                 }
    16.             }
    It needs to go to line 223, before muscles = newMuscles; is called.

    Hey,
    Does the jitter still happen when you disable "Update Joint Anchors" in PM?
    Not really familiar with Inventory Pro so I don't know how it spawns stuff or what it does. Pooling is definitely the way to go with puppets, there are loads of calculations done when puppets are initiated and that can be avoided by pooling. Spawning mid-game might give you some hickups.
    Anyway, if you could send me that project or a repro or something I could take a closer look at, that would the quickest solution to those problems.

    Hey,
    Thanks, I'll look into it ASAP. The physics/transform update structure changes messed up the demo character controller in FIK/PM, but that has already been fixed with FIK 1.7 and PM 0.7. Haven't found any other problems with it yet.

    Best,
    Pärtel
     
    RakNet likes this.
  6. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,677
    Hi all,

    Thanks to Bumd, I found a critical bug in the latest version. If you see puppets fly away at a weird velocity when they get unpinned, that is because of a bug in BehaviourFall.cs. Please import this hotpatch

    I also uploaded version 0.71 to the Store.

    Sorry for that mistake!
    Pärtel
     
  7. MostHated

    MostHated

    Joined:
    Nov 29, 2015
    Posts:
    507
    If this were to be used with say 8-10 players, would all of them end up needing their own two collision layers if it were going to be a free for all fight type situation?

    I have also noticed that occasionally when stopping my game the joint broadcasters and the other item don't come off the puppet and I have to go through and remove them all by hand from each item. Any idea what is up with that?
     
    Last edited: Feb 9, 2018
  8. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,677
    Hey,
    No, you can actually have them all on the same layer, BehaviourPuppet will not process collisions that come from colliders in the same hierarchy as the puppet. The two layer approach is used in the demos because most games have factions and it s easier like this to define different collision resistance and handling for friends and foes and stuff like that.

    About JointBreakBroadcasters, I'm a bit confused since they are added to the muscles by PuppetMaster when it initiates in play mode. PuppetMaster.Initiate is a private function and called from either Awake or Start depending on whether the puppet was created in Editor or via script. PuppetMaster.cs does not execute in edit mode so I can't see how those components could remain there after you stopped play mode. Only maybe if you copied the puppet in play mode, stopped the game and pasted it back to the Editor. Any way I could reproduce this?

    Best,
    Pärtel
     
  9. MostHated

    MostHated

    Joined:
    Nov 29, 2015
    Posts:
    507
    Unfortunately, there is no way I can think of to try and duplicate this, as I was simply tweaking some settings of an unrelated component and just started and stopped the game a few times and then noticed there was the triangle wanting signs on all of the components under the puppet hierarchy. That was actually the second or third time it happened. There may be more going on with that though because when it happened this time my character also lost his assigned texture at the same time. I had to go back in and reselect the texture in the material setting of the skinned mesh component. I had not done any copy and pasting of any sort though, only starting and stopping the game.
     
  10. Tega-dumuje

    Tega-dumuje

    Joined:
    Mar 23, 2016
    Posts:
    2
    hey
    I am using puppet master for a melee game , I have tried to replicate the punching scene interaction but I find out that setting my own character creates a more stiff collision i will like to know how the victim dummy its so loosed and not stiff like mine 2018-02-10.png
     
  11. beowulfkaine

    beowulfkaine

    Joined:
    Apr 3, 2014
    Posts:
    125
    Hey everyone, I'm using playmaker with this and I'm wondering if there is a way to change this:

    if (Input.GetKeyDown(KeyCode.D) && !isDead) {
    // Play the death animation
    animator.CrossFadeInFixedTime("Die Backwards", 0.2f);

    to an action in playmaker? This is for a vr game so I want the enemy to do this from being shot
     
  12. MostHated

    MostHated

    Joined:
    Nov 29, 2015
    Posts:
    507
    Please see the attached video. I can't seem to get my puppet to lineup with my player correctly anymore. Fix muscle transform is not working. In the video you will see how the colliders are off and remain so when I pool the character and spawn it again. It also seems to leave a single thing behind once the game starts as well. I hit the fix transform button twice, once before starting the game, once after, but things still are weird. Any suggestion?

     
  13. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,677
    Hey,
    If you have textures going missing and stuff like that, it's probably something other than PuppetMaster, I really have no idea, sorry.

    Hey,
    The upper body muscle pin weights have been reduced in the individual muscle settings under PuppetMaster, that's why they are looser.

    Hey,
    They seem to have a rather nice manual on writing custom actions.

    Hey,
    Looks like something changed the pose of the character in Editor. Scrubbing the Animation window while the character is selected might do that for example. Anyway, you can use a script like this:

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using RootMotion.Dynamics;
    4.  
    5. public class FixPuppet : MonoBehaviour {
    6.  
    7.     public PuppetMaster puppetMaster;
    8.  
    9.     [ContextMenu("Ragdoll To Target")]
    10.     public void RagdollToTarget() {
    11.         foreach (Muscle m in puppetMaster.muscles) {
    12.             m.joint.transform.position = m.target.position;
    13.             m.joint.transform.rotation = m.target.rotation;
    14.         }
    15.     }
    16.  
    17.     [ContextMenu("Target To Ragdoll")]
    18.     public void TargetToRagdoll() {
    19.         foreach (Muscle m in puppetMaster.muscles) {
    20.             m.target.position = m.joint.transform.position;
    21.             m.target.rotation = m.joint.transform.rotation;
    22.         }
    23.     }
    24. }
    25.  
    Add it to your character, assing PuppetMaster and then right-click on it's header to select whether you want to move the ragdoll to the target or the target to the ragdoll.

    Cheers,
    Pärtel
     
  14. Tega-dumuje

    Tega-dumuje

    Joined:
    Mar 23, 2016
    Posts:
    2
    just wanted to ask if there any future plans to work with the invector templates
     
  15. Nick-Metnik

    Nick-Metnik

    Joined:
    Sep 28, 2013
    Posts:
    8
    Super new to this product, hopefully this isn't a dumb question.

    I'm trying to figure out the intended way to subscribe to the collision events on a puppet master to get "what" and "where" (i.e. ball, hit head).

    Please excuse me if it's in the support materials. I checked but the closest I could find was "broadcasting..." but I'm not sure what to listen for.

    Thank you!
     
  16. MostHated

    MostHated

    Joined:
    Nov 29, 2015
    Posts:
    507
    Thanks man, appreciate it, that seems to have done the trick! Also, when you forget to turn PuppetMaster off and then mount your horse that has a working collision layer with PM, hilarity ensues, lol.

     
    Nick-Metnik likes this.
  17. IDreamofIndie

    IDreamofIndie

    Joined:
    Dec 24, 2014
    Posts:
    37
    I have been trying to figure out what is causing an issue that I'm having with Puppetmaster colliders miss aligning with my mesh when killing the puppet.

    I think I've narrowed it down to being the Grounder FBBIK.
    GroundedOn.png GroundedOff.png
    The Image with the misaligned colliders Grounder FBBIK is ON.

    Could this be what is causing the misalignment?
    Could there something else that would cause the puppet colliders to become misaligned?
    Thanks
     
  18. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,677
    Hey,
    There's an integration package for Invector's third person controller under Plugins/RootMotion/PuppetMaster/_Integration. It's quite old though, not sure if it will work with the latest Invector stuff.

    Hey, welcome aboard!

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using RootMotion.Dynamics;
    4.  
    5. public class MuscleCollisionHandler : MonoBehaviour {
    6.  
    7.     public BehaviourPuppet puppet;
    8.  
    9.     void Start() {
    10.         puppet.OnCollisionImpulse += OnCollisionImpulse;
    11.     }
    12.  
    13.     void OnCollisionImpulse(MuscleCollision m, float impulse) {
    14.         Debug.Log("Puppet collided with " + m.collision.collider.name);
    15.     }
    16. }
    Hey,
    Nice video, lol. If your puppet falls off the horse, you'll need to make sure to unparent it from it too, otherwise the ragdoll would remain parented to the horse and inherit it's motions.

    Hey,
    Yeah, might be the Grounder, but since the character is dead and ragdolled, you don't need the Grounder anyway, just blend grounder weight out when the puppet dies.

    Best,
    Pärtel
     
    Nick-Metnik likes this.
  19. Nick-Metnik

    Nick-Metnik

    Joined:
    Sep 28, 2013
    Posts:
    8
    Solved my problem. Thank you Pärtel. Love the assets!
     
  20. adamz

    adamz

    Joined:
    Jul 18, 2007
    Posts:
    848
    @Partel-Lang,

    Is there a way to rotate individual colliders so they fit my character better? Here is an example, the Forearm colliders need a bit of a rotation...

    Colliders.gif
     
  21. MostHated

    MostHated

    Joined:
    Nov 29, 2015
    Posts:
    507
    Look at his reply to my post just up one, the code should probably help you as it did me.
     
  22. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,677
    Hey,
    There's no way in Unity to rotate colliders, that problem needs to be fixed in the 3d app used for creating the model. The axes of the bones need to be re-oriented so that one of them aligns with the direction towards the next bone. In Unity the only thing you could do is remove colliders from those bones and add them to a child gameobject which you can rotate, but really, it should be fixed on the model side.

    Best,
    Pärtel
     
  23. RakNet

    RakNet

    Joined:
    Oct 9, 2013
    Posts:
    84
    In PuppetMasterHierarchyAPI.cs there is a bug where if the puppet is in disabled mode, the dropped prop is not reenabled when released.

    From RemoveMuscleRecursive(...)

    Code (CSharp):
    1. switch(removeMode) {
    2.             case MuscleRemoveMode.Sever:
    3.                 DisconnectJoint(muscles[index].joint);
    4.  
    5.                 for (int i = 0; i < muscles[index].childIndexes.Length; i++) {
    6.                     KillJoint(muscles[muscles[index].childIndexes[i]].joint);
    7.                 }
    8.                 break;
    9.             case MuscleRemoveMode.Explode:
    10.                 DisconnectJoint(muscles[index].joint);
    11.  
    12.                 for (int i = 0; i < muscles[index].childIndexes.Length; i++) {
    13.                     DisconnectJoint(muscles[muscles[index].childIndexes[i]].joint);
    14.                 }
    15.                 break;
    16.             case MuscleRemoveMode.Numb:

    Fix:
    Code (CSharp):
    1.  
    2. private void DisconnectJoint(ConfigurableJoint joint) {
    3.  
    4.             if (mode == Mode.Disabled)
    5.                 joint.gameObject.SetActive(true);
    6.  
     
  24. dyupa

    dyupa

    Joined:
    Dec 21, 2016
    Posts:
    9
    Hi, Partel!
    Could you tell me please, is there a different way (except through the Inspector) to call specific UnityEvent under Events section in BehaviourPuppet script? I want to count a player's falling by + 1, when he is (for example) at OnLoseBalance event, but I can't realize, how can I do this via code from another script.
    Thank you very much! :)
     
  25. h00man

    h00man

    Joined:
    Apr 17, 2017
    Posts:
    23
    hey partel,
    is there any way to change your character puppet script to add a double jump for the player and when doing the double jump play a different animation for second jump?
    i don't know which part of character controller script is responsible for jumping and addforce to rigidbody upward.i also need my player to be floating in the air for a few seconds exactly like jet pack effect.
    thanks a lot
     
  26. adamz

    adamz

    Joined:
    Jul 18, 2007
    Posts:
    848
    Thanks for the tip. I adjusted the model and it's bones, but now the problem I'm having is that it wont display the Capsule collider, only the Box collider when I switch between them using the Ragdoll Editor. Any thoughts on this? Thanks.
     
  27. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,677
    Hey,
    Thanks! You are right, will add this fix to the next version.

    Hey,
    Not sure if I understood, did you mean you need to add a UnityEvent listener via script?
    You can do that like so:
    Code (CSharp):
    1. public BehaviourPuppet puppet;
    2.  
    3.     private int fallCounter;
    4.  
    5.     void Start() {
    6.         puppet.onLoseBalance.unityEvent.AddListener(OnLoseBalance);
    7.     }
    8.  
    9.     void OnLoseBalance() {
    10.         fallCounter ++;
    11.     }
    Hey,
    Yes, please import this, then enable "Double Jump Enabled" under the character controller. Will be added to the next version too.

    Hey,
    Might be a bug with the RagdollEditor. Try converting to capsule, then deselect the character and select again, does it show up?

    Best,
    Pärtel
     
    dyupa likes this.
  28. dyupa

    dyupa

    Joined:
    Dec 21, 2016
    Posts:
    9
    Hello, Partel!
    Thank you very much again. You have understood everything correctly. This is what I needed. Now everything works great. ;) Thank you for your time and your great support!
    Hooray!
     
  29. adamz

    adamz

    Joined:
    Jul 18, 2007
    Posts:
    848
    That did not work. I even tried it on the old model in which it worked before, but that also has the same problem. However I did create a new project and that fixed the issue.
     
  30. h00man

    h00man

    Joined:
    Apr 17, 2017
    Posts:
    23
    beautiful.
    thanks man you got it all right
    do you think it's possible to do something about floating in the air for couple of seconds as if he is using a jet pack?
     
  31. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,677
    Hey,
    if the jetpack is physically simulated, you could unpin the puppet and link the body of the puppet to the jetpack using a joint of some kind.
     
  32. chaneya

    chaneya

    Joined:
    Jan 12, 2010
    Posts:
    369
    Partel,

    Just wondering if there are any built in optimizations for OnCollisionImpulse. I'm already using Puppet Master Settings to disable Collision Stay and Exit Messages. But when my puppets get tied up in combat, I get dozens of OnCollisionImpulse collisions. I run through a good amount of code in OnCollisionImpulse to test for various actions.

    I'm not sure exactly how this relates to Max Collisions in Behavior Puppet. When I set that to 1, I still get dozens of collisions each time by puppets come together.

    I'm wondering if there is a way to limit the number of collisions over a given time period or something like that. I can create a timer system myself to test things but I thought I would check first.

    Thanks
    Allan
     
  33. somosky

    somosky

    Joined:
    Feb 15, 2014
    Posts:
    91
    Hi sorry for posting a question that has probably been answered but there's 32 pages of comments on here haha. I have a fps raycast system that adds force to objects that it hits. I'm trying to implement a enemy hit system that is effected by this force. So for example if I shoot the enemies leg the force from the gun will make the enemy lose balance and fall. It seems like Puppet Master will allow me to accomplish this but I'd just like some clarification on that before purchasing. Also it looks like the system adds some sort of a collider system to each bone. Do these colliders act as a normal Unity collider where I could attach a script to certain bones and when they are hit call a function? Thanks .
     
  34. h00man

    h00man

    Joined:
    Apr 17, 2017
    Posts:
    23
    hey partel,
    i sorry if my question is noobie.
    could you tell me how can i set a different animation for second jump when the character is doing a double jump?( i mean in the airborne blend tree). or how to replace the jumping animations with our custom animations?
    it would be great if you make a video tutorial on you tube like the perfect ones before. and explain how the animator script and third person character controller script works
    and how to replace different animations of blend trees with our own?
    thanks
     
  35. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,677
    Max collisions limits the number on collisions processed per a fixed update step. You might be getting dozens of them because they happen over multiple fixed updates.

    You could set an impulse threshold that returns from your collision function if the impulse is too low to ignore small irrelevant collisions.

    You could also adjust "Default Contact Offset" under physics settings, a smaller value would reduce the number of collision events produced by Unity in the first place. That value can actually be adjusted for each collider independently (collider.contactOffset) if you wish to only change it for the puppets.

    Hey,
    Yes, you can shoot those puppets with raycasts. There is a demo (Puppet Raycast Hit) included for that and the scripting part looks like this:

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using RootMotion.Dynamics;
    4.  
    5. namespace RootMotion.Demos {
    6.  
    7.     public class RaycastShooter : MonoBehaviour {
    8.  
    9.         public LayerMask layers;
    10.         public float unpin = 10f;
    11.         public float force = 10f;
    12.         public ParticleSystem blood;
    13.  
    14.         // Update is called once per frame
    15.         void Update () {
    16.             if (Input.GetMouseButtonDown(0)) {
    17.                 Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
    18.  
    19.                 // Raycast to find a ragdoll collider
    20.                 RaycastHit hit = new RaycastHit();
    21.                 if (Physics.Raycast(ray, out hit, 100f, layers)) {
    22.                     var broadcaster = hit.collider.attachedRigidbody.GetComponent<MuscleCollisionBroadcaster>();
    23.  
    24.                     if (broadcaster != null) {
    25.                         broadcaster.Hit(unpin, ray.direction * force, hit.point);
    26.  
    27.                         blood.transform.position = hit.point;
    28.                         blood.transform.rotation = Quaternion.LookRotation(-ray.direction);
    29.                         blood.Emit(5);
    30.                     }
    31.                 }
    32.             }
    33.         }
    34.     }
    35. }
    The colliders used by PuppetMaster are normal Unity 3D colliders.

    Hey,
    The character controller used in the package was made for just demo purposes, it doesn't extend very well to your custom needs, or at least modifying it would require very good scripting/animation skills. I suggest you grab one of the character controller packages from the Store that were designed for everything you intend to achieve.

    Anyway, please import this package, then you can open the animator controller and just change the animation clips in the "DoubleJump" state on the Base Layer.

    Best,
    Pärtel
     
  36. westryder907

    westryder907

    Joined:
    Dec 28, 2016
    Posts:
    24
    Hello,

    I've had Puppet Master for a while now and I'm just getting around to really digging into the options and functionality past the sheer entertainment of crushing my puppets with heavy cubes.

    For the past 2-3 months now I've been trying to integrate Puppet Master with another AI system (Emerald AI) but I'm having game breaking issues when I go to create puppets out of my Emerald AI characters.

    Everything goes together after a bit of a struggle, however my issue is when the puppet gets knocked down the AI still acts as if it's making navigational decisions and will still move around leaving my puppet and the AI effectively in 2 different places which leaves my puppet spinning around at the AI's root position.

    I'm really starting to dig in on Puppet Master and allowing it to teach me new things but I've spend countless hours attempting to solve this issue and I think I'm just done attempting to fix this myself so I am reaching out.

    Here's a video I made on a test level demonstrating exactly what I'm talking about.
     
  37. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,677
    Hey,
    Haven't tried Emerald AI, but the basis of integrating PuppetMaster with a third party AI is to disable all rotation and movement of the character by that AI while
    Code (CSharp):
    1. behaviourPuppet.state != BehaviourPuppet.State.Puppet;
    so there must be a way to disable the AI while the puppet is unpinned or getting up.

    This is done for the third person controller of the Standard Assets in this tutorial.
     
  38. westryder907

    westryder907

    Joined:
    Dec 28, 2016
    Posts:
    24
    Thank you for your response,

    I tried using the behavior events and was able to disable the EmeraldAI component but I think the 'AI brain' is still getting instructions.

    I've watched the video you've posted about 5 times over the course of owning Puppet Master (Also have Final IK, thank you!).

    I'll scrutinize the info from the video again and attempt to apply it to my scene.

    Thank you!
     
  39. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,677
    Hey,
    Have you asked the dev of Emerald AI about what the intended way of pausing it is? By pausing I mean just not updating the position and rotation of the character.
     
  40. somosky

    somosky

    Joined:
    Feb 15, 2014
    Posts:
    91
    I bought your asset a few days ago and I'm loving it. I was able to add Puppetmaster into my game with really good results within an hour. Thank you for answering my question the other day about ray casting.

    I do have a question though if you wouldn't mind helping out. So I have a enemy that's a normal height and weight that I'm ray casting with a pistol and hitting the puppet and adding force similar to the demo scene which is working great. If I use my shotgun more force is added and he flies across the room which is just great to look at. The issue I'm having is now I'm trying to add in a 2nd larger character and I would like the pistol to effect him very little and the shotgun to effect him a good amount but not as much as the first character. The pistol and shotgun will be adding the same force regardless of which character it hits .

    So my question is is there a way to alter the puppets ragdoll rigidbody "weight". I figured I could just go and increase the mass of every rigidbody on the puppet but I didn't know if that would be the correct way of doing it.
     
  41. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,677
    Hey, thanks for the purchase!
    Yeah, you can just increase the weight. In the "Melee" demo the teddy is heavier than the others. You might want to tweak some params like add more "Muscle Spring" to that heavier puppet because heavier ridigbodies are heavier to actuate.
     
  42. somosky

    somosky

    Joined:
    Feb 15, 2014
    Posts:
    91
    Hi. Are there any examples or would you have a recommendation on how to add explosive force to a puppet? I was thinking of using a overlap sphere to collect all of the collider but that seems to be extremely inefficient. I also considered just collecting one collider but then if there were more than 1 puppet wouldn't have them effected. Also would I need to unpin the puppet and then add the explosive force and if so how would can I unpin the puppet through code? I don't seem to be able to access the Behavior Puppet Script through get component.
     
  43. PicturesInDark

    PicturesInDark

    Joined:
    Jun 13, 2013
    Posts:
    67
    dyupa and mwituni like this.
  44. Chapmanly

    Chapmanly

    Joined:
    Nov 1, 2016
    Posts:
    2
    Hi, Partel-Lang, my question is if the puppetmaster stagger child under the Behaviours GO is handling the arm flailing and the leg losing balance animations. If so I am troubleshooting to see if it's the values that is making the Staggering backwards, just fall on it's back rather than flailing it's arms or if it's because I don't have an animation attached to it. I'm currently thinking it may just be values.
     
  45. petey

    petey

    Joined:
    May 20, 2009
    Posts:
    1,196
    Hi all,

    I'm looking into PuppetMaster but I struggling a bit, I'm not sure if it will be overkill for my project and I was wondering if someone could help out.

    Firstly my project is designed for mobile, and secondly I only want the character to be controlled by physics at the point that they get hit rather than continuously.
    Does that sound like it will work?

    Thanks,
    Pete
     
  46. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,677
    This is how you would make a land mine:
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using RootMotion.Dynamics;
    4.  
    5. public class LandMine: MonoBehaviour {
    6.  
    7.     public int puppetLayer;
    8.     public float explosionForce = 1000f;
    9.     public float explosionRadius = 2f;
    10.  
    11.     void OnTriggerEnter(Collider c) {
    12.         if (c.gameObject.layer != puppetLayer) return;
    13.         if (c.attachedRigidbody == null) return;
    14.  
    15.         var m = c.attachedRigidbody.GetComponent<MuscleCollisionBroadcaster>();
    16.         if (m == null) return;
    17.  
    18.         foreach (BehaviourBase b in m.puppetMaster.behaviours) {
    19.             if (b is BehaviourPuppet) {
    20.                 var p = b as BehaviourPuppet;
    21.                 p.SetState(BehaviourPuppet.State.Unpinned);
    22.  
    23.                 foreach (Muscle muscle in m.puppetMaster.muscles) {
    24.                     muscle.rigidbody.AddExplosionForce(explosionForce, transform.position, explosionRadius);
    25.                 }
    26.             }
    27.         }
    28.  
    29. Destroy(gameObject);
    30.     }
    31. }
    Hey, thanks for sharing! Looks great, what parts did you do with FIK and PM?

    Hey, the arm windmill is not animation, it is done procedurally with IK. If it's not doing anything with the arms, it could be a problem with the "Windmill Weight" or "Muscle Weight" under the "Arms" header in BehaviourBipedStagger. Try copying these curves over from the demo character if they are different.

    Hey,
    PuppetMaster is very heavy on the CPU on mobile, but I have seen a mobile game (Help!! Zombies) using PuppetMaster with up to 6 simultaneous puppets.
    You can have your character be controlled by physics only if they get hit. You would set BehaviourPuppet's "Normal Mode" to "Kinematic" or "Unmapped" to do that.

    Best,
    Pärtel
     
    petey likes this.
  47. PicturesInDark

    PicturesInDark

    Joined:
    Jun 13, 2013
    Posts:
    67
    FIK for Ground and PM for shoots reaction. Works great!!!
     
  48. PicturesInDark

    PicturesInDark

    Joined:
    Jun 13, 2013
    Posts:
    67
    In the first video you can see PM shoots reaction


    For ground FIK handling with tripods and heroes
     
    mwituni likes this.
  49. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,677
    Cool, looking great! I put your game down to my little list of games powered by FIK if you don't mind.

    Cheers,
    Pärtel
     
    mwituni likes this.
  50. Chapmanly

    Chapmanly

    Joined:
    Nov 1, 2016
    Posts:
    2
    Hi Partel, I'm running into a problem where I'm enabling and reorienting my nav agent after the puppetmaster plays the get up animations, but because they are in a crowd of other AIs with the same behaviour, they get up and when the nav agent reorients its position it causes the AI that got up to pop if they are in the radius of the nav agent.
    Similarly, the nav agent of the ones moving pushes the agent which I would like to avoid. I realize these questions may not necessarily pertain to puppetmaster, but I was wondering if there was a solution to this?