Search Unity

Motion Controller

Discussion in 'Assets and Asset Store' started by Tryz, Feb 21, 2014.

  1. crazymonkey7787

    crazymonkey7787

    Joined:
    Oct 1, 2017
    Posts:
    4
    Thank you for all your help and time, it is very appreciated.

    I looked through the basicmeleeattack.cs like you suggested. I ended up using my two separate motions based on your original basic melee attack, named right fist and left fist. On the left fist, where you grab and set the mWeaponCore.PrimaryWeapon, I changed to mWeaponCore.SecondaryWeapon. (I followed the .PrimaryWeapon and found you had a secondaryweapon setup.) It worked like a charm and a super easy fix for my two right and left fist motion setup. Now time to duplicate and create dual swords.. maybe single sword and fists... ect.. ect.. haha

    Thank you
     
    Tryz and hopeful like this.
  2. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,683
    I haven't attempted to set it up for dual weapons, but this is how I expected to be able to do it. Glad to hear it worked! :)
     
  3. erpatton

    erpatton

    Joined:
    Oct 6, 2014
    Posts:
    55
    I'm sure this has been asked before, but for some reason, the search functionality on the forums isn't letting me just search for "jog"..

    So, I'm using the BasicWalkRunPivot, and it's working great for me with no delay in moving around, but the character doesn't start moving with my controller until I push the stick to a certain point.

    I'd like it to start moving the character right when any value over something small like 0.05f is detected, and I'd like it to transition between a walk and a jog animation when the stick is fully pressed forward. How would I go about adding this behavior? I know how to add the extra transition of a jog to the animation, I just have no idea where in the code to add/modify this behavior.
     
  4. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    Hi Tim!
    I'm making a death motion for my character and made a ragdoll on my character's bones, I'm wondering how can I blend actor controller to ragdoll with all the velocity on character's death, then blend back with cleared velocity when I revive the character?
     
  5. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    That is awesome! Well done. :)
     
  6. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    What you're saying is exactly right.

    I'm limiting the movement is in the WalkRunPivot_v2.cs motion itself. In there, I have a minimum "magnitude" on the input before I'll let the motion activate. Line 340 shows this:

    Code (CSharp):
    1. if (mMotionController.State.InputMagnitudeTrend.Value > 0.1f)
    The real reason I did that is because of the Xbox controller. They are notorious for reporting values like 0.03 even when the left stick isn't being pressed. You can change some of that in the Unity Input manager, but I felt it was safer to have a higher minimum.

    You'll see this minimum input value in both the TestActivate() and the TestUpdate() functions.

    If you want to change this, you could copy the WalkRunPivot_v2.cs file and name it something custom. Change the class attributes at the top too and it will show your class in my motion selector. Then, you can customize that 0.1 to be whatever you want.


    For the jog animation...

    So, I think of it like this:
    0 magnitude = idle
    0.5 magnitude = walk
    1.0 magnitude = run

    You can actually see that in the BasicWalkRunPivot-SM.UnarmedBlendTree blend tree:



    You can copy the animator and then modify this by injecting a jog and changing the threshold values. This would just be standard Unity animator work.

    Once you do that, Unity will blend in your jog as you set. You won't need to change anything in my code.
     
  7. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Very cool. I can't wait to see that in action.

    You'll just want to take full control of the movement when you're ready (going in and out of ragdoll).

    You have a couple of options:

    1. Change the AC.UseTransform option to true. When set, you have complete control over the character's position and rotation by changing "transform.position" directly. Any movement coming from the MC or AC itself will be totally ignored.

    This approach is easy, but it disables my collision detection, grounding, etc. You're 100% in control of the character's position (which isn't always a good thing).

    2. The other option is to use the AC.Move() or AC.SetVelocity() functions. These functions are additive. Which means they will use the movement from motions + whatever you set for the ragdoll.

    This approach could be a bit trickier as you may want to counter some existing velocity. However, collision detection and grounding will be handled by me. Since the character is flopped on the ground, you may not want this.


    I haven't worked with ragdolls in a long time. So, I'm not really sure what else happens. Hopefully this gives you a place to start.
     
  8. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    Great, I'll try this!
    Now my method is to disable actor controller and at the same time enable all the rigid bodies and colliders on my player's bones(simple unity ragdoll), but the issue is there is no inherited speed on these rigid bodies, so the character stops moving immediately after going into ragdoll. And this also may cause a constant movement after I re-enable the actor controller after player's revive, which is quite annoying from time to time.
     
    Tryz likes this.
  9. GamePowerNetwork

    GamePowerNetwork

    Joined:
    Sep 23, 2012
    Posts:
    257
    Thank you so much @Tryz for this asset.

    I just have one burning question that I can't figure out yet. I've enabled control of the character while jumping and that works fine. However I want the character to face in the direction I'm moving mid-jump and not just the direction the camera is looking. Currently by default, if I jump and then, mid-jump I move around, the character kinda enters an air-strafe mode where he is always facing the direction he was in when the jump started and only moving his position, not rotation.

    PS: I'm using the adventure move type... so I want full control of the actor's rotation.. even while jumping. Also, when i'm doing a running-jump I can't control the character at all.
     
    Last edited: Jul 27, 2018
  10. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Hey @PyroStudios. :)

    In both these cases, I'd have to say this falls under the heading of "Working as designed". That said, I understand that my design may not be exactly what your design calls for. The cool thing is that you can customize the existing motions or create new ones for your unique needs.

    In the case of Jump, I'll show you a very basic way of adding rotation based on user input. It's not smoothed and you probably want to limit when the rotation occurs, but this is a good starting point...

    At line 883 of Jump.cs, add this code:
    Code (CSharp):
    1. if (!_RotateWithCamera)
    2. {
    3.     mRotation = Quaternion.Euler(0f, mMotionController.State.InputFromAvatarAngle, 0f);
    4. }
    When the jump motion is active (and Rotate With Camera is not checked), this will force the rotation to the input. Again, it's a quick and dirty approach, but it works. Now you can improve it by adding smoothing, conditions, etc.


    As you go down the road of customizing the motions, start by making a copy. This way updates won't revert your changes. For example, copy my Jump.cs to PyroJump.cs and then change the class attributes. Now, PyroJump will show up in my list of available motions.

    You'd make the code changes above to PyroJump.cs.
     
  11. GamePowerNetwork

    GamePowerNetwork

    Joined:
    Sep 23, 2012
    Posts:
    257
    Thanks! This helps a lot.
     
    Tryz likes this.
  12. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    Hi Tim,
    I've used MCS character with motion controller for may game: Survisland, but the system got some bind bone issues on my customers' build game(downloaded from steam)
    So I'm considering change my character system into UMA2, and would like to know if MC can also work with UMA2 out of the box, or is there any extra steps I should take before they can work together?
     
  13. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957
    Yes, it works very smoothly with MC. The best approach is to use the UMA Bone Builder Tool when you're creating the character prefab(s). This creates the skeleton at design time, so you can set up the Body Shapes (Actor Controller), etc at design time.
     
    Tryz and recon0303 like this.
  14. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    Thanks! Is the bone builder tool included in the UMA 2 package or should I find it in the store separately?
     
  15. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,683
    It's a feature of UMA 2.7.
     
    TeagansDad likes this.
  16. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    Thanks! I'm watching tutorial vids right now, learning how to use it.
    What happens if I just add the motion controller scripts on the UMA2 place holder? Will it be working out of the box?
     
  17. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,683
    It's been a while since I've played with this. In fact, I think I had some sort of favorable bug two years ago when I was actually able to use UMA straight with MC. But the general idea is that UMA is procedural, so the character doesn't exist in the editor. Unfortunately, most tools - like MC - require you to be in editor mode to assemble the character prefab by hand. So you use the bone builder feature of UMA now to create a skeleton you can use in the editor, and this gets it all working happily.
     
  18. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957
    Almost. The Actor Controller won't be able to create the Body Shapes correctly at design time; the code that does this is in the ActorControllerEditor, so it's not something you can do at runtime.

    I submitted a UMA support package to the ootii Motion Vault a while back (before the Bone Builder tool)... I think it's still up. There's a script in there that creates the Body Shapes when the UMA is created.
     
  19. recon0303

    recon0303

    Joined:
    Apr 20, 2014
    Posts:
    1,634
    That is why many of us love MC. We can make what we want:) and have the control we need.
     
    Tryz likes this.
  20. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    Hi Tim,
    I found a weird behavior of my camera controller(its your Camera Controller asset, not the basic camera rig from MC)
    I enabled the camera collision to avoid camera intrude to objects.
    And a x axis offset on the fixed orbit motor.
    Then I found it that when my character is walking towards an obstacle and got stopped by the object then continues to walk (he won't move, just playing the animation), the camera ignores the x axis offset from time to time making the character to the center of my view.
    Then there are several issues with motions, the jump and fall motion stuck me in air a lot, especially when there is a small gap right under the character, the grounding test won't see him as grounded but the collider continues to keep him in air.
    And for climbing, if the character is climbing to a narrow space, the test climb method can not recognize it and still let him climb up then he'll just struggle with the collisions then pop up to the next floor.

    Here is a video to show all the issues
     
  21. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    This would make sense because you're forcing the 'arm' your camera into the hut. Notice that the character is centered with the camera when you're rotating the camera to the right (at 0:27) and comes back out when you rotate to the left (0:29).

    Hopefully this picture makes sense. Image the camera is looking into the screen at the red dot. If it can't go out to the full x-offset due to a collision, I have to pull it in.




    For the character hanging in the air at 0:04:
    I'm guessing you're pushing the character forward while he's in the collision. I think what's happening is you're forcing the character into the wall.

    It's like when you push a ball against a wall. The wall stops it from moving, but the force of your hand pushing it against the wall also keeps the ball from falling.

    I can probably add logic that if you're not grounded and colliding, stop any input. However, it might cause other odd situations (like ramps) to not work as people expect. I'll play with it.


    For the popping up during a climb at 0:46:
    I'm not sure what your colliders look like, but I'm guessing your roof collider isn't very tall. Hence your open area.

    I do one raycast above the max height to see if the way is clear. If it is, I allow the climb to happen. Since you've got this open space, the climb seems valid.

    When I get the chance, I can probably do an "OverlapCapsule" test at the expected end point of the climb. If that hits something, I'll stop the climb. It shouldn't be too bad on performance.


    One last thought... Since no character controller can handle every possible situation in every possible environment, level design becomes really important. That's why level designers block out the levels with colliders before it ever gets pretty. They make sure there are no gaps for the character to fall in and they can't climb areas they aren't supposed to.

    For example, if your character can't fit between those gaps and therefore can't climb into it. Then put a box collider there to ensure it never happens.


    I'll do what I can to help these situations, but nothing will be better than making sure it can't happen in the level design itself.
     
    twobob, hopeful and TeagansDad like this.
  22. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    I didn't add any force on the character, simply kept the character's initial velocity while jumping, and there can be no control in air.
    I didn't use add force or impulse to the character. Can constant velocity also cause this behavior? For I didn't set the velocity to zero while colliding things in air.
    Regarding to level designing, my game world is procedurally generated in runtime, and I did my best to set the rules to avoid bad areas, but it is not totally safe, random values can always get you.
    And I allow players to building complex structures as they like, so this becomes to another problem, I can't control my players' creativity for buildings, if they just simply put two boxes the right distance to each other, they walk on it, then jump, they got stucked. So I'll have to make my character controller solid on most of the cases.
    I think MC can achieve this, and I can use some advices from you :)
    Actually all motions in my game are rewritten by myself, and I learned a lot from your codes, also expanded many functions from them (like I assembled all climbing motions into a baseClimb motion and other climb motions for different heights are derived from this base one)

    And about the camera x offset explaination just made me clear of the situation. I tried to read the codes about the offset in camera controller, but didn't get the purpose of the sphere cast to the pivot. Now I get it, but I don't think it's safe to move camera's x offset according to the character's head, he can be squeezing in a tight area and his head may pop in and out of colliders, this will make the camera pops between 0 offset and full offset, maybe just keep the camera where it is, only change the position when itself is colliding something?
     
  23. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957
    What is the Grounding Radius set to on your ActorController? The default value is 0.1; I find that bumping that up to at least 0.3 helps with many of the "getting stuck midair over a small gap" situations.

    I've also found that even 1m wide gaps can cause that issue... I think it's because the ActorController uses a set of sphere colliders that follow the curvature of the spine fairly accurately, whereas most other character controllers just use a capsule collider and some of those just leave the capsule upright even though the character is leaning forward. So with the AC's body shapes, the lean forward in the default jump/fall animations makes the with of the character greater than 1m if measured from the farthest point back (the heel) to the farther point forward (the head). @Tryz, correct me if I'm wrong on that. :cool: It's just a deduction I made from looking at the colliders on the player (in the Scene view) when he got stuck in a 1m wide gap.

    This particular example in your video (climbing up the straw "marketplace" stall) would pose problems for any character controller that I know of -- the geometry isn't a good fit for climbing. On top of that, the whole structure should actually just topple over towards you as soon as you try climbing onto it, given the complete lack of structural support on the front. ;) Restricting climbable structures to ones that make sense you'd be able to climb can eliminate a lot of these odd behaviors. In this example, when climbing onto the top of the stall, the character is essentially doing the equivalent of performing a full pull-up on to a pull-up bar and then climbing on top of it -- which is extremely difficult for anyone but a trained gymnast to do. It's far more believable if any ledge that you can pull up to has a vertical wall below it to brace one's feet against when climbing. And it's also much less problematic on the technical side.:D
     
  24. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    I set it as 0.25, and does not use unity colliders on the actor controller body shapes options.

    As for the structure I was climbing, it was not a pre-built structure, but a runtime generated building that I allow my players to build, they got building integrites to determine if they should flop or stay static. In this case the character's weight is not enough to topple this slope. I simply can't add extra colliders on this kind of shape, for I can't detect every stuckable possibility that players may create. You can check out the steam page of my game :Survisland
    and see my building system in the trailer. I give my players maximum freedom to build their buildings, then I must make the character controller an equivalent to this complex environment. I just have to solve every problem through code rather than scene design, for the scene is no longer designed by me, but all the players :D
     
  25. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957
    Well, you've got your work cut out for you, man. ;) Not an unsolvable problem by any means, but definitely a lot of work involved in getting it right.

    Your game looks pretty cool... I'm not really a fan of the survival genre, but I like to support other indie devs. My computer doesn't meet your minimum system requirements though. I have the 8GB of RAM and an Nvidia GTX 960M but my CPU is an i5-6300HQ (2.3 GHz; 5th-generation i5). Any idea if it would be playable on that?
     
  26. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Definitely cool and I'll help how I can. We'll just have to see what kind of crazy things people come up with.

    The fact that you're building your motions and have a good handle on the flow will be a big help.

    Once I get some breathing room, I'll check out the things I mentioned above.

    Correct. Think of the three of four spheres as being slanted forward.

    That's awesome. Congrats on the "Very Positive" reviews too!
     
    Harekelas likes this.
  27. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    The current optimizations of my game is still poor, will take my hands on this section once the major functions are finished.
    Your enthusiasm is very appreciated! But I suggest you wait a bit longer till us bring more features into the game, especially when you are not a survival fan :)
     
    Tryz likes this.
  28. clarson2974

    clarson2974

    Joined:
    Aug 24, 2015
    Posts:
    20
    @Tryz I'm currently using motion controller and the archery, sword and shield, and magic packs in a VR project. The question I have is related to aiming the bow (probably run into this on the magic pack later). The player character is currently not attached to a camera but is setup to follow a cursor around. The problem is that I need the character to aim at this cursor instead of just straight ahead of where he is facing. Initially I'm not seeing a way to do that via configuration - do I need to create my own motion to accomplish this? If not can you point me in the right direction?

    I found a post (from 2016 I think) where someone was trying to make the aiming follow a mouse cursor and at that time it sounded like you might be working on this capability within a couple of weeks so that it would work better for NPCs. Not sure if you ever got to that (I know how that can be).

    And as I type this up I wonder if maybe I should be using the target locking under the Combatant script somehow...

    Any help is greatly appreciated!
     
  29. alexsheppard5

    alexsheppard5

    Joined:
    May 31, 2018
    Posts:
    9
    Hi everyone! I'm wanting to purchase motion controller (and the other bundles it comes with) but was wondering how to integrate it with ORK Framework!!

    Please let me know if you can help me out so I can get started sooner :)

    Thank you!!
     
  30. Salja

    Salja

    Joined:
    Mar 23, 2017
    Posts:
    353
    Why I no longer use Motion Controller !

    First, let me say that Motion Controller is still the best thing in the store that can get it.

    But:

    I got the motion controller last year 16. Apr. 2017, (I own all the packages of ootii) there were really some bugs in that time, but Tim had the time and energy to fix it all.
    In this time last year, Tim has really fixed many bugs and developed new stuff to make the motion controller always better.

    Tim got a really good job and I'm really happy for him but unfortunately the motion controller has been with him since the day.

    I totally understand it when he does not have that time anymore like early around I respect it too, but unfortunately there are bugs I have addressed for months that make a game experience impossible.

    It is also really a pity that until today there is not really a good fight solution, I have really tested a lot (Node Canavas, Ice Creature Controll, EmeraldAI) but none of those were really good the fights have felt boring.
    When I saw then that Tim was working on his own system, I was very happy about it, unfortunately, it has not been finished until today which really makes me very sad.

    I've tried to bring something into the community so I did Playmaker actions, unfortunately, these are for my personal use not to use, but somebody will be able to use them.

    Of course I could do everything myself but unfortunately here is the problem you have to understand everything first to be able to do it yourself in the end.

    I do not want to talk bad things here, I like Tim he is a very good person and has helped me a lot, but unfortunately from the other point of view, I can not continue to use the motion controller in this form.

    I really hope that sometime the Tim will find the time to work on it I would be very happy if I can someday use the Motion Controller again as he said is the best you can buy in the store.

    I would also like to say thank you for over a year of great work, I hope Tim will eventually find the time again, I'll come back then immediately.
     
  31. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    I wish you the best of luck.
     
    Salja likes this.
  32. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    As you mention, when Enable Look IK is checked I use the camera's rotation to drive the direction of the spine. I do that in the BasicRangedAttack.RotateSpineToDirection() function. From there, the "IK Angles" property are used to adjust the direction of the arrow (from the normal animated direction).

    I don't have anything that follows an arbitrary rotation, but I think that would be easy to do. In this case, inherit from BasicRangedAttack and change the class name and attributes. That gives you a unique motion... say "ClarsonBasicRangedAttack".

    Then, override the RotateSpineToDirection() function to ignore the rotation. You could add any logic you want to rotate the spline. Everything else should just work.

    Feel free to email tim@ootii.com if you need help.
     
  33. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Hey Alex,

    I'm sure some people here will be able to help more, but there are a couple of features that I include that will go a long way to help with integration with any other asset:

    1. Unity Events
    On the MC and most of my assets, you'll find that I have a section for "Events". These allow you to tap into motions as they activate, deactivate, and at certain times.



    You can create custom functions that look for one of the events above and does whatever you want.


    2. Reactors
    Reactors also allow you to write custom code in response to gameplay events, messages, and state changes. You can learn more about reactors here:

    Reactors


    3. Messages
    One of the ways I raise events and reactors is through messages that get sent around. These messages contain information about who attacked, the damage, etc. Notice in the image above how each event takes an "IMessage"?

    So, you can respond to damage, cause damage, or force a reaction using these messages. As an example, check out how I use messages in combat here (page 7):
    Sword and Shield Motion Pack User's Guide.

    You can also see all the message that exist here:
    Message IDs


    So, armed with this information you can do integration with other assets (like ORK) by handling their events (however they do it) and then create messages like this and send it into the MC or included Actor Core.


    Code (CSharp):
    1. CombatMessage lMessage = CombatMessage.Allocate();
    2. lMessage.ID = 1150;
    3. lMessage.Defender = this;
    4. lMessage.Damage = _10f;
    5.  
    6. this.ActorCore.SendMessage(lMessage);
    7. CombatMessage.Release(lMessage);

    The trick with any integration is just finding the connection points. These are mine. Unfortunately, I just haven't used ORK myself.

    (BTW... I'll turn this into a post on my site)
     
  34. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957
    I'm the guy to talk to about this. ;)

    I've got a pretty substantial library of integration code for ORK Framework, including Motion Controller. It needs a bit of cleaning up and reorganization, but I hope to get back to that in couple of weeks once I've finished what I'm working on right now.

    What sort of game are you trying to make? I've had ORK + MC working for real time combat as well as turn-based (including the grid combat). They're fairly different by nature, so my approach to integration varies as well.
     
    Tryz likes this.
  35. clarson2974

    clarson2974

    Joined:
    Aug 24, 2015
    Posts:
    20
    Thanks! That is some good info, and helps get me going in the right direction. It also confirms I wasn't missing something. I didn't want to go creating a new motion and then find out I could have just configured it :)
     
    Tryz likes this.
  36. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    Any chance of updating the docs on UMA + MC They are like woefully ancient now
    The stuff referenced doesn't even exist.
    upload_2018-8-1_21-11-6.png

    Cheers
     
  37. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    This is the video that Secret Anorak put up in March of 2018. Is this no longer valid?


    The PDF you took a screen shot is older and I'll remove it to get rid of confusion.
     
    twobob likes this.
  38. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,683
    It should be fine.
     
    Tryz likes this.
  39. alexsheppard5

    alexsheppard5

    Joined:
    May 31, 2018
    Posts:
    9
    real time combat!! my hope is to make a game SIMILAR (obvious no where near as good) to borderlands..just kind of a fun project. I have experience with ork and love the rpg framework it contains but would just love to include motion controller as my player controller as it has by far the best feel to it. and the addons for different "classes" already exist i would just have to further develop them so it would be perfect!!

    if you were able to help me out i would owe you major :)
     
    Tryz likes this.
  40. GamePowerNetwork

    GamePowerNetwork

    Joined:
    Sep 23, 2012
    Posts:
    257
    Hi @Tryz

    I hope this hasn't been asked already, but do you plan on implementing Unity ECS for motion controller and the plugins?
     
    Tryz likes this.
  41. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Yes... But, I don't really know what that means yet.

    The last thing I read said that a stable version won't exist until the end of the year. Since it's shift in how we code for Unity, I'm expecting there will also be lots to learn and work through.

    In the mean time, TeagansDad has been a huge help in re-factoring the ootii project to support the Unity assembly definition files. This is another cool feature Unity introduced that I'm working to support as it cuts compile times down drastically.
     
    recon0303 and GamePowerNetwork like this.
  42. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    The video is good. Just pointing out that the docs were a bit dated.



    Works fine fwiw. tested as okay.
     
    hopeful and Tryz like this.
  43. Melle_

    Melle_

    Joined:
    Jul 16, 2018
    Posts:
    15
    Is it possible to use Motion Controller for NPC movement?
    If so what parts do I need?. Do I need the motion controller or is actor controller enough?

    In the Animator controller Humanoid I dont see any transitions is that right. Does the motion controller dont use transitions? And is it working with Blend tree?
     
  44. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Yes. Check out this video that explains all the ways you can do NPC movement.


    I use the MC to manage animations. So, if your NPC needs to be animated and you're not doing it yourself, the MC can. I talk about that in the video too.

    The newer "Basic Walk Run Strafe" and pivot motions don't have much in the way of transitions. There would be one from the Any State.
     
  45. Melle_

    Melle_

    Joined:
    Jul 16, 2018
    Posts:
    15
    Nice, that made it more clear.

    Problem is it doesnt work for me NPC character just falls down true the ground after following the guide in 19:16 in the video.

    I should have the animations they are in the Assets/ootii/MotionController/Content/Animations/Humanoid at least.
    When I check the animator window they link to the animations in that place.
    When I look at Walk Run Rotate I can see the animations.
    Using a copy of the Humanoid controller.

    You never say anything about Motion Layer but I did like the video and put in "Locomotion" in Motion Layers.

    EDIT: My problem was that I had Camera rig, Find check I uncheck that and it worked.
     
    hopeful likes this.
  46. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    I'm not really sure what you mean.

    The walk motions and animations have been around for a couple of years and they are used by almost everyone. I'm sure they work.

    Is it possible you forgot to put a collider on the ground?
     
  47. FiveFingerStudios

    FiveFingerStudios

    Joined:
    Apr 22, 2016
    Posts:
    510
    I'm looking for an easy way to add NPCs to my game that I can give them a transform position/rotation and they will walk there and position themselves using the standard unity Nav Agent.

    Is this possible with your asset?

    I don't want to write any code that uses animation controllers with blend trees AND root motion animations, but want the functionality out of the box.
     
    Last edited: Aug 3, 2018
  48. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Yes. Check out this video at 13:25. It gives you several approaches. The later ones use the MC and will animate the character.

     
  49. FiveFingerStudios

    FiveFingerStudios

    Joined:
    Apr 22, 2016
    Posts:
    510
    Thanks for the video.

    How can this be used with blendtrees? I don't see how I could supply the values needed for them.

    For instance, the Third person Controller in Unity Standard Assets uses both "Turn" and Forward" parameters. Can you asset apply the appropriate values for that?
     
  50. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    My included animator controller sub-state machines do use blend trees, but they use the animator parameters that the MC uses. I talk about those in the Motion Builder's Guide (page 12):
    http://www.ootii.com/unity/motioncontroller/MCMotionBuilder.pdf

    The MC comes with it's default motions, animations, animators, parameters, and sub-state machines. You can just replace the animations if your animation some-what match my sub-state machines. The "Basic Walk Run X" motions are great for that. You can also do some basic sub-state machine changes within my animators if the transition flows stay close to how I have them.

    If you create a brand new animator parameter, I won't know anything about that. If you want totally new sub-state machines and animation flows, you'll need new motions to manage thoes custom flows and use the animator parameters you created.

    I hope that makes sense.