Search Unity

PuppetMaster - Advanced Character Physics Tool [RELEASED]

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

  1. LightenFor

    LightenFor

    Joined:
    Dec 26, 2013
    Posts:
    26
    Tell me, please, best way to make force choke like Darth Vader with character with Puppet system. First - I took Bot Puppet from "Melee" example as Base. Next, I've made new behaviour - Air. This behaviour makes all muscles weak and Master pinWeight = 0.0f. Air Behaviour makes ragdoll similar as in "Hanging" example scene. When player use Force Choke on PuppetCharacter, I'm activating Air behaviour, and ragdoll fly away and character resume to runAnimation without movement. Please, help me!
     
    Last edited: Apr 23, 2016
  2. LightenFor

    LightenFor

    Joined:
    Dec 26, 2013
    Posts:
    26
    I suppose This happen because of root motion, but I need script name or function name to disable it. On animator root motion check box replaced with "Handled by script", but what script?
     
  3. LightenFor

    LightenFor

    Joined:
    Dec 26, 2013
    Posts:
    26
    disabling rootmotion - no effect...
     
  4. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,684
    I have no idea what could be causing this, but sometimes when you have a collider in a collider it will cause objects to zoom off in some direction at high speed.
     
  5. montyfi

    montyfi

    Joined:
    Aug 3, 2012
    Posts:
    548
    @Partel Lang is there some function opposite of Boost? For some motions I would like to weaken puppet for period of time, so any collision would turn it off.
     
  6. LightenFor

    LightenFor

    Joined:
    Dec 26, 2013
    Posts:
    26
    It happens when colliders are the same layer... And my problem is not about ragdoll flying out. I need my character tofly out with ragdoll. But character still running, ragdoll - fly.
    This is how my OnActivation function in custom behaviour looks like...

    protected override void OnActivate()
    {
    forceActive = true;
    StopAllCoroutines();
    puppetMaster.pinWeight = 0f;
    puppetMaster.targetAnimator.applyRootMotion = false;

    foreach (Muscle m in puppetMaster.muscles)
    {
    // m.props.pinWeight = 0.03f;
    m.state.immunity = 0.0f;
    m.props.muscleWeight = 0.03f;
    m.state.pinWeightMlp = 0f;
    }
    }

    And this is how It looks like BEFORE activation of my behaviou

    And this is AFTER

    Weights were affected correctly, but mesh were no affected by ragdoll(
    It should be girl on the floor in ragdoll, but she is animated and staying.

     
    Last edited: Apr 24, 2016
  7. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Quick question:

    from http://blogs.unity3d.com/2016/04/13/unleashing-animation-and-audio-2/

    Wondering what benefits this would have for pm and fik
     
    montyfi likes this.
  8. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    Hi!, I just replied to your email on this matter.
    I'm thinking, usually when I see the ragdoll limp on the ground and the character maintains animated as normal although mapping weights are 1 and PuppetMaster state is Active, it is because there is some kind of an error in the Console that has stopped PuppetMaster's work. Let me know if that's not the case here. Are you also using BehaviourPuppet?

    IK, procedural animation, physics based systems and such are obviously something that can be done as it is, but that callback is something I have hoped to see for years now. It would help me get rid of hundreds of lines of code, just to get a call every time (and only when) animation has been applied on a hierarchy. It is a ridiculously simple issue, but something that has just not been possible with Mecanim so far. For example, if your character is in Animate Phsyics mode, it is not possible to read the animated pose of the character between the animation and the physics. As a workaround, I disable the Animator, update it manually in FixedUpdate, read the pose, send it over to the muscles to process before the PhysX update, then re-enable the Animator again so you could toggle it on/off. Of course, being able to get rid of hacky workarounds like that would also help reduce bugs.
    Also, it would probably help with performance, being able to make adjustments in ProcessFrame before the transformations are applied on the bones. As it is, when bones have colliders on them it is very expensive to make changes to the pose, as the colliders have to be recalculated each time. That is one of the main reasons I have to maintain a dual rig for the puppets.
    So I will definitely look into it when it matures a bit. Although I wouldn't like to ditch Legacy just yet.
     
    one_one and hippocoder like this.
  9. LightenFor

    LightenFor

    Joined:
    Dec 26, 2013
    Posts:
    26
    Yes, I'm using BehaviourPuppet... But I call my behaviour outside through GetComponent<...>().Activate(), I thought this will deactivate BehaviourPuppet automaticly! No errors in console...
     
  10. LightenFor

    LightenFor

    Joined:
    Dec 26, 2013
    Posts:
    26
    OK, I handle this! Threason was that in PuppetBehaviour it was Normal Mode Unmapped and I though It will be disabled after Behaviour switch, but It was not. Changing Unmapped to Active solves the problem! Thanks for support! upload_2016-4-25_14-11-46.png
     
    hopeful likes this.
  11. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    Calling Activate() on a behaviour should activate it, unless you do it before the behaviour has initiated. I'll add a warning for that.
     
  12. montyfi

    montyfi

    Joined:
    Aug 3, 2012
    Posts:
    548
    Perhaps my question was lost somehow, may I ask again?
    What if I want to weaken puppet for a period of time, like opposite to your Boost function. How can I do that?
     
  13. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    Oh, sorry..
    If you boost the other character that would look the same I guess. Or decrease collision resistance and lerp it back to what it was.
     
    montyfi likes this.
  14. montyfi

    montyfi

    Joined:
    Aug 3, 2012
    Posts:
    548
    Thanks, I will try to play with collision resistance.
     
  15. Der_Kevin

    Der_Kevin

    Joined:
    Jan 2, 2013
    Posts:
    517
    i asked opsive who did behavior designer and he is interested doing a puppetmaster integration into bd. but he had some questions: http://forum.unity3d.com/threads/be...rees-for-everyone.227497/page-38#post-2612119

    maybe you can answer that question if you like? since i don't want to tell him something wrong :)
     
  16. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    Der_Kevin likes this.
  17. JFol

    JFol

    Joined:
    Apr 30, 2016
    Posts:
    1
    Hey I am having trouble with the fall over behaviour when using multiple layers in mecanim, is this common?

    With a single layer my character trips over small walls and gets up perfectly like shown in the demo scenes. But when I add a 2nd layer (One for upperbody and one for legs) the character falls over but when getting up kinda just floats into the pinned position and runs his legs around. The Behaviours sub states are on the base layer.

    Any ideas?
     
  18. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    Hi!

    The other layers must be overriding the animations on the base layer. Try setting the weights of the other layers to 0 and if getting up works like that, you'll need to blend those weights in when puppet.state == behaviourPuppet.State.Puppet and out if it's something else.
     
  19. Der_Kevin

    Der_Kevin

    Joined:
    Jan 2, 2013
    Posts:
    517
    iam just trying to use the bot puppet from the melee scene with a navmesh agent. do you ever tried that? it seams to work when i turn off the "character animation third person" script but i dont know if thats a good idea or just a "hack"?
     
  20. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    Hi,
    In the melee scene there is the main puppet that uses UserControlMelee script and the bots use UserControlAIMelee.cs. Implementing navigation should ideally be done by making an user control script that follows a path. Basically you'd have to edit UserControlAIMelee to follow a path instead of going straight towards the target.
    It doesn't work with NavMeshAgent, but that is one of those sealed Unity components that you'll run into limitations with sooner or later anyway.

    You can use this script to get started with a custom navigator:

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. /// <summary>
    5. /// Calculates and updates a NavMeshPath based on the position of a character.
    6. /// </summary>
    7. public class Navigator {
    8.  
    9.     /// <summary>
    10.     /// Is this navigator currently following a path?
    11.     /// </summary>
    12.     public bool onPath;
    13.  
    14.     /// <summary>
    15.     /// The path. Use CalculatePath to fill it in.
    16.     /// </summary>
    17.     public NavMeshPath path = new NavMeshPath();
    18.  
    19.     /// <summary>
    20.     /// Gets the index of the corner currently followed. If no path, will return 0.
    21.     /// </summary>>
    22.     public int cornerIndex { get; private set; }
    23.  
    24.     /// <summary>
    25.     /// Calculates a path from startPosition to endPosition. The path will be stored in this instance of the Navigator and used by calling GetMoveDirection.
    26.     /// </summary>
    27.     public bool CalculatePath(Vector3 startPosition, Vector3 endPosition) {
    28.         onPath = false;
    29.  
    30.         if (NavMesh.CalculatePath(startPosition, endPosition, NavMesh.AllAreas, path)) {
    31.             if (path.corners.Length > 0) {
    32.                 onPath = true;
    33.                 cornerIndex = 0;
    34.             }
    35.         } else {
    36.             NavMeshHit navHit;
    37.  
    38.             if (NavMesh.SamplePosition(endPosition, out navHit, 3f, NavMesh.AllAreas)) {
    39.                 if (NavMesh.CalculatePath(startPosition, navHit.position, NavMesh.AllAreas, path)) {
    40.                     if (path.corners.Length > 0) {
    41.                         onPath = true;
    42.                         cornerIndex = 0;
    43.                     }  
    44.                 }
    45.             }
    46.         }
    47.  
    48.         return onPath;
    49.     }
    50.  
    51.     /// <summary>
    52.     /// Gets the move direction based on the current position of the character.
    53.     /// </summary>
    54.     public Vector3 GetMoveDirection(Vector3 currentPosition, float stopThreshold = 0.5f, float cornerThreshold = 0.5f) {
    55.         if (!onPath) return Vector3.zero;
    56.  
    57.         Vector3 moveDirection = Vector3.zero;
    58.  
    59.         if (onPath) {
    60.             moveDirection = path.corners[cornerIndex] - currentPosition;
    61.  
    62.             float threshold = cornerIndex >= path.corners.Length - 1? stopThreshold: cornerThreshold;
    63.  
    64.             if (moveDirection.magnitude < threshold) {
    65.                 cornerIndex ++;
    66.  
    67.                 if (cornerIndex >= path.corners.Length) {
    68.                     Stop();
    69.                     moveDirection = Vector3.zero;
    70.                 }
    71.             }
    72.  
    73.             moveDirection.y = 0f;
    74.         }
    75.  
    76.         return moveDirection;
    77.     }
    78.  
    79.     /// <summary>
    80.     /// Gets the next corner point.
    81.     /// </summary>
    82.     public Vector3 GetNextPosition(Vector3 currentPosition) {
    83.         if (!onPath) return currentPosition;
    84.         return path.corners[path.corners.Length - 1];
    85.     }
    86.  
    87.     /// <summary>
    88.     /// Stop this Navigator.
    89.     /// </summary>
    90.     public void Stop() {
    91.         onPath = false;
    92.         cornerIndex = 0;
    93.     }
    94.  
    95.     /// <summary>
    96.     /// Visualize the path in Scene View.
    97.     /// </summary>
    98.     public void Visualize(Vector3 currentPosition) {
    99.         if (!onPath) return;
    100.  
    101.         Debug.DrawLine(currentPosition, path.corners[cornerIndex], Color.blue);
    102.  
    103.         for (int i = cornerIndex; i < path.corners.Length - 1; i++) {
    104.             Debug.DrawLine(path.corners[i], path.corners[i + 1], Color.blue);
    105.         }
    106.     }
    107. }
    Basically just define an instance of the Navigator, then use navigator.CalculatePath(character.position, target.position); and call navigator.GetMoveDirection(character.position) each frame and move your character towards whatever it returns.

    Cheers,
    Pärtel
     
    montyfi likes this.
  21. montyfi

    montyfi

    Joined:
    Aug 3, 2012
    Posts:
    548
    So much useful info in your FIK/PM threads. It would be pretty useful to combine all that info in FAQ somewhere.
     
  22. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    I've done so many different things with Unity over the years so I just have those snippets about almost everything :)

    Anyway, I'm finally done with the first networking demo.
    I'm not an expert on multiplayer though so I'm not sure if it's the best way to go about it and all feedback and advice is most welcome.

    Cheers,
    Pärtel
     
  23. Der_Kevin

    Der_Kevin

    Joined:
    Jan 2, 2013
    Posts:
    517
    hey thanks! was just a quick idea i had but after investigating navmeshes more and more i think its a bad idea.
    anyways, i have a - not only puppetmaster related question. maybe you have a lighning idea :D so i wanted to create some puppetmaster actions for nodecanvas. for this i had a look at the already done final ik actions. a simple look at action looks like this for example: http://pastebin.com/dFBdkh5W

    so, based on that i wanted to create the usercontrolAi as an action. which looks like this at the moment:
    Code (CSharp):
    1. using NodeCanvas.Framework;
    2. using ParadoxNotion.Design;
    3. using UnityEngine;
    4. using RootMotion.Dynamics;
    5.  
    6.  
    7. namespace NodeCavasAddons.Puppetmaster
    8. {
    9.     [Category("Puppetmaster")]
    10.     [Name("Ai Move")]
    11.     [Description("Move the Ai Bot")]
    12.     public class PuppetmasterMove : ActionTask {
    13.  
    14.         public Transform moveTarget;
    15.         public float stoppingDistance = 0.5f;
    16.         public float stoppingThreshold = 1.5f;
    17.         public Transform transform;
    18.  
    19.         public bool repeat;
    20.  
    21.         public struct State {
    22.             public Vector3 move;
    23.             public Vector3 lookPos;
    24.             public bool crouch;
    25.             public bool jump;
    26.             public int actionIndex;
    27.         }
    28.  
    29.         public bool walkByDefault;        // toggle for walking state
    30.         public State state = new State();
    31.         protected Transform cam;                    // A reference to the main camera in the scenes transform
    32.  
    33.  
    34.         protected override void OnExecute(){Move();}
    35.         protected override void OnUpdate(){Move();}
    36.  
    37.         //void Start () {
    38.             // get the transform of the main camera
    39.         //    cam = Camera.main.transform;
    40.         //}
    41.  
    42.         void Move()
    43.         //protected override void OnExecute()
    44.         {
    45.            
    46.             float moveSpeed = walkByDefault? 0.5f: 1f;
    47.  
    48.             Vector3 direction = moveTarget.position - transform.position;
    49.             direction.y = 0f;
    50.  
    51.             float sD = state.move != Vector3.zero? stoppingDistance: stoppingDistance * stoppingThreshold;
    52.  
    53.             state.move = direction.magnitude > sD? direction.normalized * moveSpeed: Vector3.zero;
    54.  
    55.             // calculate the head look target position
    56.             //state.lookPos = transform.position + cam.forward * 100f;
    57.  
    58.         }
    59.     }
    60. }
    but the result of this is, that the puppet doesnt move. the characterPuppet.cs script is on my character controller(where also the nodecanvas with the action above is placed) and in there is a child with the animation controller. just like in the melee demo actually. is there anything at the script above that doesent make any sense to you?
     
  24. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    Hi,
    Yes, the Move function fills in the state, but there is nothing using that state.
    If you look at the CharacterThirdPerson script (that CharacterPuppet inherits from), it has a reference to a UserControlThirdPerson. It will use it's state as input to calculate the movements. So your script needs to extend UserControlThirdPerson and be referenced as "User Control" in the CharacterPuppet.

    Cheers,
    Pärtel
     
  25. bmcv123

    bmcv123

    Joined:
    Feb 28, 2014
    Posts:
    6
    Hi Partel,

    Thank you for the great asset! The script you built for PuppetMaster to work with Ootii's Motion Controller 2 is especially helpful. But I'm having trouble figuring out how to accomplish something with this setup.

    I have a few NPC's that are generated from prefabs at runtime. When they move around, I want them to be able to collide with each other and fall down. But I can't find a way to get them to recognize collisions with each other without creating collisions between their ragdolls and their character controllers.

    I had to disable collisions in Motion Controller 2 because it was causing them to slide and fly all over the place. How do I get them to ignore collisions with themselves, but recognize collisions on the same layer with another NPC?

    Thank you for your help!
     
  26. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    Hi!

    In PuppetMaster there is the "Internal Collisions" toggle that you can use to make the ragdoll ignore their own collisions without disabling ragdoll-ragdoll layer collisions.
     
  27. bmcv123

    bmcv123

    Joined:
    Feb 28, 2014
    Posts:
    6
    I have that toggle disabled. Maybe I'm not understanding how to set up the layer collisions correctly? In the Ootii Puppet Script, I can't have the "Character Collides with" set to the ragdoll layer (it triggers a warning). But if I have the "Ragdoll Collides with" set to the character collider layer, my characters either pass through each other or slightly jitter/shake as when they do collide.

    Do I need to create a separate collider on a different layer to get them to collide with each other?
     
  28. Der_Kevin

    Der_Kevin

    Joined:
    Jan 2, 2013
    Posts:
    517
    so actually this:
    Code (CSharp):
    1.  public class UserControlAI : UserControlThirdPerson {
    but nodecanvas also needs a reference to the Action Task like this:
    Code (CSharp):
    1. public class PuppetmasterMove : ActionTask
    but this seams to be the wrong approach:
    Code (CSharp):
    1. public class PuppetmasterMove : ActionTask<UserControlThirdPerson> {
    So that the whole part looks like this :

    Code (CSharp):
    1. using NodeCanvas.Framework;
    2. using ParadoxNotion.Design;
    3. using UnityEngine;
    4. using RootMotion.Dynamics;
    5.  
    6.  
    7. namespace NodeCavasAddons.Puppetmaster
    8. {
    9.    [Category("Puppetmaster")]
    10.    [Name("Ai Move")]
    11.    [Description("Move the Ai Bot")]
    12.    public class PuppetmasterMove : ActionTask<UserControlThirdPerson> {
    right? at least unity is complaining about the <UserControlThirdPerson> part
     
    Last edited: May 5, 2016
  29. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    Hey,
    You should have "Character Collides With" set to all the ground, wall and other objects that the character walks on/against. "Ragdoll Collides With" indicates just the layers that will unpin the puppet on collision, but they are not the only layers that the ragdoll will collide with physically. Depending on your Layer Collision Matrix there might be others, so I suggest you see if that (in play mode, to make sure all scripted changes to it have been applied) checks out.

    It might be easier to just go to CharacterThirdPerson.cs and change the type UserControl to what you have.

    Pärtel
     
  30. Der_Kevin

    Der_Kevin

    Joined:
    Jan 2, 2013
    Posts:
    517
    ok, thank you, got it working now :)
    simple run-to-nearest-taget behavior. works great now :)
     
    Last edited: May 6, 2016
    Partel-Lang likes this.
  31. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    Hi all,
    Just to let you know, I'll be off the grid next week so probably wont be able to answer any questions before the week after that.

    Best,
    Pärtel
     
  32. ez06

    ez06

    Joined:
    Feb 18, 2014
    Posts:
    45
    Hi Pärtel

    1. I'm trying to make a character grab another character, like they do in rugby: one character wraps his arms around the opponent's pelvis and pushes him to the floor.

    How should I go about this?
    I have the tackle animation ready but the tackling player keeps falling because of the collision and the victim stays standing. I tried to parent the victim root to the tackling player root but all it does is translate the victim back without making him fall.

    I'm looking to make a curve so that the tackling player is invincible during the climax of the tackling animation. But what in PM am I supposed to disable/decrease during this "invincible" time?
    Also, am I supposed to use IK for that?

    2. Is it possible to have more than one fall animation? Because it becomes repetitive when the character falls exactly the same way every time.
     
    Last edited: May 11, 2016
  33. Goon-Studios

    Goon-Studios

    Joined:
    Mar 16, 2015
    Posts:
    8
    Hi Partel! I'm having a bit of difficulty with puppetmaster. I have it set up on a quadrupedal creature, and the skeleton is hanging askew so that the creature's front legs are going through the terrain:



    Which of course doesn't happen in the underlying animation. Another issue, I don't know if it's related or not, is that when the creatures run or perform a lunging attack, the model lags behind the puppetmaster skeleton quite a bit, and has a tendency to bounce in strange ways, leading to some very sloppy movement.




    I tried changing the mapping to 0, but it actually made the problem a bit worse somehow. Now the model follows the skeleton exactly, but the skeleton is bouncing into the air when the creature walks. In the image below, the creature in the foreground has its mapping set to 0. The animation it's attempting to play is the same running animation being used by the other animals in the near scene.



    Note that limb IK and the quadrupedal grounder from FINAL IK are also on the model. I don't think this is interfering, as I've tried disabling those components and the same thing still happens.

    Thanks!
     
  34. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
  35. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    Hi everyone, I'm back finally and thank you for your patience!

    Hi,

    1. There are Boosters. Basically you define a Booster in your script and call booster.Boost(puppet) when you're about to tackle:

    Code (CSharp):
    1. public BehaviourPuppet puppet;
    2.     public Booster booster;
    3.  
    4.     void OnTackle() {
    5.         booster.Boost(puppet);
    6.     }
    2. You can change the Animation State name in BehaviourPuppet get up events:

    Code (CSharp):
    1. puppet.onGetUpProne.animations[0].animationState = somethingElse;
    Hi!

    Try unchecking "Angular Limits", "Internal Collisions" and checking "Update Joint Anchors" and "Support Translation Animation".

    It might be that the angular limits or internal collisions are restricting the motion of the joints or there are inaccuracies because the joint anchors are not getting updated.

    If that's not it, could you send me a repro project?

    Hi!

    I just tried Edy's great tool with a normal ragdoll (no PM stuff, just colliders and CharacterJoints) and it would usually just explode underneath the car so I don't think it's a problem with PM. Probably something wrong with the forces applied to objects by the wheel colliders I guess, since everything seems to work fine until the wheels touch the ragdoll. I tried increasing the mass of the ragdoll by 10-100 times and that fixed it (you'll have to multiply Muscle Spring in PuppetMaster too and adjust collision resistance in BehaviourPuppet when you multiply the ragdoll's mass). Might be because Unity's physics doesn't like large mass differences (the default vehicle weighs 1000). I can PM you a project with a demo if you'd like.

    Cheers,
    Pärtel
     
  36. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Hi @Partel Lang - got a few issues integrating puppetmaster with various things.

    Problem 1:
    Firstly, I want to make the upper body only floppy so that's the 2nd spine (chest) upward. I do this using puppet.SetMuscleWeights for head, spine, arm, hands.
    But weirdly, it affects the pelvis (hips) as well - and this one is mapped. I don't want it to do so and I'm wondering if it's due to a set up issue or other issue?

    Problem 2:
    I have a jeep and want to put the puppet into it so we can driver around. When I do this, the physics of the puppet throw the jeep off course. The puppet's combined mass is 80kg and the jeep's combined mass is 1000kg. Also the puppet is having a lot of trouble trying to stay with the jeep. What recommendations do you have to solve this? I'm open to any approach that would still allow some physics feel yet keep him seated without it drifting away and so on... of course, the controller is properly seated in the jeep.

    Thanks for any help and insights as you know puppetmaster better than I do :)
     
  37. Der_Kevin

    Der_Kevin

    Joined:
    Jan 2, 2013
    Posts:
    517
    i actually did a car enter exit experiment with puppetmaster and randomation car physics: https://gfycat.com/FluidGreatBorderterrier

    iam not having too much time right now to explain how it works but here is the script, maybe that helps:
    http://pastebin.com/9M5XeTvK

    lots of uncomment stuff and even more outcommented but maybe it helps you in a way. will write a more detailed explaination when i have more time :)
     
  38. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Thanks Der_Kevin, looks like the joint approach helps a lot. I did try that but it seemed to affect the car's physics too much - I guess I could adjust all the masses when in the car...
     
  39. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    Hey, I replied to your mail about the first issue. The second, I haven't tried it with vehicles much yet, but I guess reducing ragdoll mass while in the car would help. Or another thought, what if you got the velocity and angular velocity deltas of the vehicle and added them to all ragdoll rigidbodies. Or at least half of it or something. I'm guessing the effect of the ragdoll on the vehicle seems ill proportioned because you apply forces to the vehicle through steering, braking and accelerating, but those forces don't get applied to the ragdoll as smoothly through friction as they would in reality, instead you'll get a lot of collisions. So if you transferred the changes in the vehicle's velocity and angular velocity directly to the ragdoll, I guess it will make things smoother.

    Cheers,
    Pärtel
     
    hippocoder likes this.
  40. Der_Kevin

    Der_Kevin

    Joined:
    Jan 2, 2013
    Posts:
    517
  41. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    I don't think negative time scales would work with the puppet behaviours. That would require switching states and other internal variables. PuppetMaster.mode and .state probably won't work too.
     
  42. Alfonso_CJ

    Alfonso_CJ

    Joined:
    Nov 19, 2015
    Posts:
    35
    Hey I've got a problem with the Script, this is what the results are The car moves when the player moves and it collides with the player aswell. I also had to remove BasicInput because it caused Compiler Errors, however, is this correctly setup?
     
    Last edited: May 19, 2016
  43. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Try switching puppet to kinematic for the rewind, should work fine. It won't be physically simulated while rewinding but hasn't chronos already recorded that simulation? as it comes out of rewind it should be simulated again.
     
    Partel-Lang and hopeful like this.
  44. Alfonso_CJ

    Alfonso_CJ

    Joined:
    Nov 19, 2015
    Posts:
    35
    I know how to pin it and all that other stuff, juts need your help here.
     
  45. Der_Kevin

    Der_Kevin

    Joined:
    Jan 2, 2013
    Posts:
    517
    I see that the exit point and door trigger left is the same object. The exit point should be outside of the enter trigger and the door trigger left on the driver seat
     
    Partel-Lang likes this.
  46. Alfonso_CJ

    Alfonso_CJ

    Joined:
    Nov 19, 2015
    Posts:
    35
    Yeah I fixed that now but I'm stuck with the bug that controls the car whenever i'm walking around as the ThirdpersonCharacter
     
  47. Der_Kevin

    Der_Kevin

    Joined:
    Jan 2, 2013
    Posts:
    517
    heyhey, quick question. how can i check if a puppet is currently losing balance?
    i mean, i can sent an event from "on lose balance" from the behavior puppet editor but can i also check it somehow?
     
  48. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    When a ragdoll collider collides with something, it will loosen it's (and it's surrounding) muscle's pins. That allows the ragdoll to drift away from it's animation. When a muscle gets too far from it's target (knockOutDistance), it will cause the whole puppet to lose balance at which point the "on lose balance" event will be called. So there's no linear "balance" factor. Not exactly sure what you need to do here, but you can check if and how much any of the muscles are unpinned. Its muscle.state.pinWeightMlp; If it's less than 1, the muscle has taken some damage. You can also use muscle.positionOffset to know how far it is from it's target.
     
  49. Fluffy-Tails

    Fluffy-Tails

    Joined:
    Jun 28, 2009
    Posts:
    120
    Hi there Partel, first I want to say thank you for creating such an awesome gem! :3

    My question to you is does Puppet Master or Final IK support object penetration from another object?

    An example of this is like putting a finger in jello.
    The Jello's vertices would deform based on the finger vertices creating a penetration and would go back to normal after pulling the finger out.

    Thank you for your time, I have been looking for something that can create a penetration effect like that.
     
  50. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    Thanks Janet,
    No, sorry, it's not something PM or FinalIK can do. If it can't be faked with blend shapes, then you are probably looking for a soft body physics solution like this.

    Cheers,
    Pärtel