Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Motion Controller

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

  1. montyfi

    montyfi

    Joined:
    Aug 3, 2012
    Posts:
    548
    Hello Tim. After a long break due to having a baby I'm on track again. About a year have passed, perhaps a lot of new things are done in motion controller... may I ask if you have input source for Vive controllers by some chance? I can do it myself but don't want to invent a bicycle if you already have done some steps in VR direction.
     
    Tryz likes this.
  2. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,399
    Welcome back and congrats! I hope everyone is healthy and happy.

    No Vive input source. Some new motion packs and major updates, but no focus on VR yet. Eventually I will get a Vive, but I'm hoping to see a price drop... maybe v2.
     
  3. Obsurveyor

    Obsurveyor

    Joined:
    Nov 22, 2012
    Posts:
    277
    Yeah, definitely not worth purchasing a Vive now without a significant price drop. They've already got a new design for controllers, light houses and now a 2ms latency wireless HDMI addon coming out of their accelerator program.
     
    Tryz likes this.
  4. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,399
    Motion Controller NPCs

    Get the latest Node Canvas integration off the Vault.

    I put together a video that takes you through setting up the MC for NPCs and how to use Node Canvas to jump, climb, and live. Check it out.

     
  5. antoripa

    antoripa

    Joined:
    Oct 19, 2015
    Posts:
    1,163
    Nodecanvas looks cool for BT ... but I would see something really advanced ....:)
     
  6. devstudent14

    devstudent14

    Joined:
    Feb 18, 2014
    Posts:
    133
    Sorry to be slow, but I can't work out how to replace the existing idle pose with a new idle etc. Adding new motions is straightforward, but how do I do a complete overhaul of all the existing states? I've watched a lot of the videos and scoured through the pdf manual. The manual mentions on three occasions that replacing existing animations is very easy, but I couldn't find anything that told me exactly how to do this. The video on replacing walk animations was interesting (
    ) , but a lot of information was left out and it certainly wasn't a step by step guide.
     
  7. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,399
    Hey @mattockman ,

    I don't typically have step-by-step guides for things like this because it's just a standard thing you do when working with Unity. Unity's docs and videos cover it pretty well.

    Note: Make sure you're using a copy of my Humanoid animator controller or I'll wipe out your changes during the next update.

    1. In the animator, navigate to the sub-state machine and state you want to change
    2. Click on the animation node or blend tree
    3. Drag your replacement animation into Unity's "Motion" slot



    Just like with any animator, if you change animations you may need to play with the transition between the animations as their times could change how blending looks. You do that to personal taste.


    Resources:
    https://docs.unity3d.com/Manual/class-State.html
    https://docs.unity3d.com/Manual/class-Transition.html
    https://docs.unity3d.com/Manual/StateMachineBasics.html

    If you're not familiar with Mecanim, you definitely want to read-up on it.
    https://unity3d.com/learn/tutorials/topics/animation/animator-controller?playlist=17099
     
    devstudent14 and TeagansDad like this.
  8. devstudent14

    devstudent14

    Joined:
    Feb 18, 2014
    Posts:
    133
    I appreciate the response. The thing that really confuses me is that there are several places that have a slot for an idle animation (and walk animation etc). The idle animation in the place you highlighted doesn't change the idle animation of my character, but the Idle animation in Idle-SM does. The IdlePose in the WalkRunPivot v2-SM also doesn't seem to have any effect on my character (I have a 'left strafe' in there now just for testing purposes).

    I'll definitely read more about mecanim, but any hints you can give to clarify my 'multiple idle slot' confusion would be appreciated! :)
     
    Tryz likes this.
  9. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,399
    Ahhh... I see.

    The main "resting point" is the Idle-SM sub-state machine and the idle animation there. So, all motions and states tend to go back there when nothing is going on. So, that's the main change.

    However, if the idle was just there, every transition would have to be the exact same length. So, climb-to-idle, jump-to-idle, walk-to-idle, and all the others would have to be exactly 0.2 seconds. As you can imagine, the transition from climb-to-idle and walk-to-idle is very different and really takes a different amount of time to look right.

    By putting an idle in each of those sub-state machines, I can have different transition times as needed. climb-to-idle could take 0.5 seconds and walk-to-idle could take 0.1 seconds. For each of those motions/sub-state machines, then I can do a faster (near instant) change to the Idle-SM.

    That means the transitions from climb (as an example) really goes like this:
    Climb-SM.Climb to Climb-SM.Idle to Idle-SM.Idle

    I hope that makes sense.

    There' s no list as to which sub-state machine has an ending idle like this. I just did it when I felt I needed to. Unfortunately, that means you have to open up each one and look.
     
    TeagansDad and devstudent14 like this.
  10. devstudent14

    devstudent14

    Joined:
    Feb 18, 2014
    Posts:
    133
    Ok, thank you. So it doesn't really matter what animation is in the idle pose state within those substates, because the substates will just default back to Idle-SM.Idle after the allotted transition time has elapsed? Is that right?

    I'm afraid I need some help with walk forward as well. I've been trying find out which walk state changes the characters walk forward animation (the walk forward equivalent of Idle-SM.Idle), and I'm getting the same problem I ran into before. In an attempt to isolate the main driver of the walk animation, I've deleted every walk forward animation I could find from:

    1. WalkRunRotate v2-SM
    2. WalkRunStrafe v2-SM
    3. WalkRunPivot v2-SM
    4. WalkRunRotate-SM
    5. WalkRunStrafe-SM
    6. WalkRunPivot-SM
    7. WalkRunTwitch-SM

    I was hoping that after deleting all of these that the character would just hover about the scene when 'w' is pressed, and then by incrementally adding them I could find the state responsible for the animation. Instead, the character has an altered, hobbled walk. What have I missed? What state continues to drive the animation even though all of the walk forward animations have be deleted from the aforementioned substates? And why is the animation 'crippled'?

    Also, how many of those substates could I safely delete and still have a functioning running, walking, pivoting and strafing character?
     
  11. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,399
    That's up to you. Remember my example: Climb-SM.Climb to Climb-SM.Idle to Idle-SM.Idle

    If Climb-SM.Idle and Idle-SM.Idle are different, there will be a change as you go from one to the other. If you're fine with that, than you're good.

    The character has a "hobbled walk" because you removed the walk animation from a blend tree. Unity's blend tree then compensates with the remaining IdlePose and RunFoward animations... they are blended.

    If you were to replace the "WalkForward" animation with your walk, it would use your walk and blend with it. In that case, you just want to make sure your walk and run cycles keep the same footing so they stay in sync.

    Again, this isn't anything specific to the Motion Controller. It's just how Unity's blend trees work.

    That won't work because I use the animation's root-motion to move the character. You'll also find that just removing the animation will cause the character to go into Unity's "I have no animation" state... which has him squatting in the ground.

    I'm not exactly sure why you want to remove them. If you don't use them (meaning you don't include a motion on your character) then they aren't used and cause no harm or performance hit.

    But, to answer your question...

    Once you choose your movement style and the motions (Idle, Walk Run Pivot, Walk Run Strafe, etc) you can remove any sub-state machine that isn't being used.

    If you click on the motion, the orange gear, and the blue gear, you can see the sub-state machine the motion uses:


    In this example, Walk Run Pivot requires the "WalkRunPivot v2-SM". It requires all states and transitions that are in that sub-state machine.

    You can replace the animations as I mentioned earlier, but removing them will cause Unity's Mecanim to act in odd ways since there's a state with no animation.

    The Motion Controller uses Mecanim and we have to play with in the rules Unity gives us.


    Can you help me understand what your overall goal is? We started with "I can't work out how to replace the existing idle pose with a new idle etc" and now we're talking about removing animations and whole sub-state machines. If I understood your ultimate goal, I might be able to help.
     
    Last edited: Dec 21, 2016
    TeagansDad and devstudent14 like this.
  12. devstudent14

    devstudent14

    Joined:
    Feb 18, 2014
    Posts:
    133
    Sorry, I just needed to know which substates were being used by the player character so I could replace the animations in that state with other animations. Deleting animations was my attempt to find this out, but it didn't work due to blending -as you pointed out. I didn't know we could find the active substate by pressing the Animator Settings key. Now that I know this, I have no problem replacing animations. Thanks for your help!
     
    Tryz likes this.
  13. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,399
    Motion Controller & NPCs

    I know the first video in the series was a bit long. These are shorter and show you some very basic combat. Use these videos as building blocks for more advanced AI. :D

    In this video, I show you how to use the Motion Controller, Archery Motion Pack, and Node Canvas to let your NPC shoot arrows:


    Here I'm doing the same thing, but without Node Canvas. This AI is raw code and what's included in the Archery Motion Pack:
     
  14. Szaruga

    Szaruga

    Joined:
    Jan 29, 2016
    Posts:
    403
    @Tryz
    Thank you for marriage Motion Controller & Node Canvas - a lovely couple ;)
     
    Tryz likes this.
  15. kurotatsu

    kurotatsu

    Joined:
    May 10, 2012
    Posts:
    588
    Hey Everybody Camera Controller is on the main slider, on the asset store!!!

    Congratz, man.
     
  16. christougher

    christougher

    Joined:
    Mar 6, 2015
    Posts:
    558
    Sooooo, here is a tiny demo of a few nav BIG nav mesh improvements in unity beta 5.6. Pretty sweet. Multiple Nav meshes can be built on different objects and use the y-up vector to bake. It moves with the object and can have ANY orientation. As you can see in my video the meshes move just fine but so far off mesh links don't adjust... Hoping they do eventually!



    Only posting it here cause I'm excited to see what you might come up with for you controller as far as sweet off mesh link transitions. I'm gonna have to dive deep to figure out some smooth and sweet Ik transitions from one nav mesh surface to the next. Also I'm trying to rack my brain as to how this can translate to full on spherical path finding/movement.
     
  17. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,399
    That is awesome. While the MC supports characters on walls and cielings, I could never use nav meshes with it... this is very cool!
     
    hopeful and kurotatsu like this.
  18. goldencruz

    goldencruz

    Joined:
    Oct 2, 2013
    Posts:
    94
    if purchased where to i fins the sword shield pack
     
  19. kurotatsu

    kurotatsu

    Joined:
    May 10, 2012
    Posts:
    588
    Sword and Shield is pending review, and should be up shortly.

    The best way to be sure you know when it it released is to keep an eye on this thread, as it will be announced here, and watch ootii's publisher page on the asset store.
     
    Tryz likes this.
  20. tchris

    tchris

    Joined:
    Oct 10, 2012
    Posts:
    133
    I got the Archery Add-on and for some reason in the demos when I press "2" to go to archery mode, the character falls into the floor up to his waist.

    Here is a screenshot:
     

    Attached Files:

  21. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,399
    Hey @tchris ,

    That's Unity default for when there is no animation.

    I'm guessing that the Unity animator can't find the archery animations. Did you download them and import them per the quick start guide?

    Please check out the steps on page 2 and make sure all the animation files and meta files are in the right place:
    http://www.ootii.com/Unity/MotionPacks/Archery/ArcheryUsersGuide.pdf

    Restarting Unity (step #7) is important too. Please let me know if that helps.
     
    TeagansDad and kurotatsu like this.
  22. tchris

    tchris

    Joined:
    Oct 10, 2012
    Posts:
    133
    Thanks I missed the step about choosing FBX for Unity instead of just FBX
     
    hopeful and Tryz like this.
  23. tachyon-particle

    tachyon-particle

    Joined:
    Jan 5, 2016
    Posts:
    79
    Hi,

    On the Third Person Motion Controller, is there a way to offset the body of the character from the ground?

    The thick sole of the boots of my character is sunk into the ground. I just need to offset the body up just a bit so the bottom of boots are touching the surface of the ground. Maybe I have overlooked some settings?

    By the way, this Third Person Motion Controller is absolutely amazing :)

    Thanks
     
  24. christougher

    christougher

    Joined:
    Mar 6, 2015
    Posts:
    558
    I'm a little slow sometimes lol... the navmesh links also can "auto update position" duh! Lol... very exciting. Quick observation... a navmesh agent will continue to navigate to the same destination in world space even if the navmesh moves... prolly easily fixed by setting a target GO on the navmesh GO...
     
    Tryz likes this.
  25. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,399
    I don't have a setting on the MC itself. I use the character's transform as the actual position.

    But, what you can do is nest your character. This way you can sink or raise them as needed. Here's an example:



    This is my typical "Jones" character. I added a "Jones Sink" transform under "Jones" and moved all the body meshes, bones, etc. to live under "Jones Sink".

    Then, I modified the position of "Jones Sink" so it's lower by 0.5 units. Now the character works like this:



    That should get you what you want. :)

    Thanks! :)
     
  26. tachyon-particle

    tachyon-particle

    Joined:
    Jan 5, 2016
    Posts:
    79
    I tried it and the solution you have presented earlier worked great! Fantastic!

    Also, I like how when I "Click to setup the motions" under the "Movement Style" section, it automatically detects to see if there is an existing Animator component attached or not; thus if not, it automatically adds one. And bravo to other auto-detections as well.

    This Third Person Motion Controller is truly a work of art, a thoroughly designed and documented framework. Totally awesomeness!

    I look forward to more greatness in the future :)
    Thanks again!
     
    kurotatsu, TeagansDad and Tryz like this.
  27. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,399
    I really appreciate that. It's nice to hear that every once in a while. :D
     
  28. christougher

    christougher

    Joined:
    Mar 6, 2015
    Posts:
    558
    Full on Spherical pathfinding in 5.6 beta albeit a quick slop job with the off mesh links :D

     
    hopeful, Tryz and TeagansDad like this.
  29. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,399
    That is crazy cool. hahaha.
     
  30. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,399
  31. nproject

    nproject

    Joined:
    Jan 16, 2015
    Posts:
    68
    Hi,
    I want to know is Motion Controller can implement third party IK like Final IK, or any other ik solutions ?
     
  32. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,399
    Absolutely :D

    Of course it's up to you to determine when to enable and disable your IK solution, but you can use it with the MC.

    If you want to integrate it directly with the MC's motions, you can create custom motions and override the OnAnimatorIK() function I provide access to. Otherwise, you run your IK solution wherever you normally would.
     
  33. nproject

    nproject

    Joined:
    Jan 16, 2015
    Posts:
    68
    Ooh great.
    I saw your videos about sword and shield when asset will be released ?
     
  34. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,399
    I submitted it to Unity about a month ago and I'm still waiting on approval. I emailed them last week and the have a backlog, but couldn't tell me much more.
     
  35. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,399
    Good news!
    After 4 weeks, Unity finally reviewed the Sword & Shield Motion Pack.

    Bad news!
    The reviewer didn't read the quick-start documentation and rejected it because it was missing animations.


    I have responded and hopefully we'll see something soon. :eek:
     
  36. kurotatsu

    kurotatsu

    Joined:
    May 10, 2012
    Posts:
    588
    They must just wanna, import it and hit play button.lol
     
  37. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,399
    Yeah, I think they are just running-and-gunning through the list.

    The fact that you have to download the Mixamo animations (due to Mixamo's licensing) threw them off. A little frustrating, but what can you do. :(
     
    TeagansDad and kurotatsu like this.
  38. kurotatsu

    kurotatsu

    Joined:
    May 10, 2012
    Posts:
    588
    LOL, i hope they run and gun AI Warrior through as fast as possible.:)

    I'm putting together a featured asset video using the newest version, so ya know MC, and Adv Camera will make an appearance.;)
     
    Last edited: Dec 27, 2016
    FargleBargle and Tryz like this.
  39. recon0303

    recon0303

    Joined:
    Apr 20, 2014
    Posts:
    1,634

    WOW.... they are bad as some people, reading helps lol..
     
  40. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,399
  41. Szaruga

    Szaruga

    Joined:
    Jan 29, 2016
    Posts:
    403
    Has already:


    for me, animation is black magic. :) I wonder how much work needs to add such things as:
    - Fight other tools such as sticks, spears, two-handed swords, two daggers, etc.

    edit//
    I was late for a few seconds ;)
     

    Attached Files:

    Tryz likes this.
  42. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,399
    hahaha... good timing.

    With an ax, you should be able to just specify a new weapon prefab in the Basic Inventory. For something like two-handed swords, I tried to lay a foundation to make these easier. I actually plan on heading down that road with some of the other Mixamo animations.

    However, I expect there will be some bugs and clean up with the Sword & Shield Motion Pack (SSMP). I just thought that part would happen earlier.
     
    TeagansDad and kurotatsu like this.
  43. kurotatsu

    kurotatsu

    Joined:
    May 10, 2012
    Posts:
    588
    Ya need to update your signature under your posts as well to link to all your packs, and add to your awesomeness, and make it easier to find.lol
     
    Tryz likes this.
  44. recon0303

    recon0303

    Joined:
    Apr 20, 2014
    Posts:
    1,634
    Thanks for the heads up , bought.:)

    Sorry Tim, I have not had a chance to test any networking , due to the holidays. and behide on a lot of my work , been playing catch up, I also just got hired to a big job for a AAA company for UI work, which is my main job that I do. So that has me backed up on my own stuff as well, as the kids .
     
    Tryz and kurotatsu like this.
  45. ISH_the_Creator

    ISH_the_Creator

    Joined:
    May 8, 2013
    Posts:
    165
    Already bought. In fact it is a shame you can't do presales lol. Can't wait to start a new project and combine all. I have all of your assets but just system events and bone controller since I have final ik.
    Keep em coming Mr Ootii
     
    Last edited: Dec 28, 2016
    kurotatsu, TeagansDad and Tryz like this.
  46. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,399
    Thanks everyone! I really do appreciate all the support.

    It makes me feel all warm and squishy. :)
     
    recon0303 and TeagansDad like this.
  47. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,399
    With the Sword & Shield Motion Packs released and the holidays almost over, I was thinking back to the list I posted earlier. Some things left to do:

    1. Organize Motion List (filters, search, etc)
    2. Update support for BD and PM (NC is done)
    3. Provide example motions for non-humanoids
    4. Documentation review and updates
    5. Full ootii setup tutorial (AC, MC, MP, BC, CC, SMP, AMP, and SSMP)

    I've got some contract work, but I'll be finishing the list up over the next 2 weeks. Then, I'll be starting on the the Magic Motion Pack.

    My goal with this is to provide a foundation for spells the same way I have for melee combat and archery.

    Feel free to post what you'd like to see in a Magic Motion Pack... spells, effects, approaches, styles, etc. Now's a good time to collect all this and be thinking about it. ;)
     
    Inspeinre and magique like this.
  48. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    955
    How in depth do you intend to go with the Magic Motion Pack?

    A fairly standard set of spells would have ones that inflict damage, as well as spells that buff or debuff the target's stats and/or inflict status conditions (poisoned, paralyzed, blinded, etc). Those would require some sort of status effects system. Plus there are various utility spells that grant new abilities, new modes of movement (flight), enhance existing movement, reveal hidden objects, enchanting weapons, etc.

    A magic system needs some means of setting and applying the cost of casting a spell. Conventionally, this is some sort of Mana stat, but it could also require certain reagents, runestones, etc.

    Each spell should probably be able to specify which casting animation to use (as well as sound effects and particle effects on casting and when the spell takes effect). Some spells need to have longer lasting effects; the duration could be dependent on a character stat.

    A magic system might cover how spells are learned (and possibly improved).

    Resistances to certain types of spells or magic effects could play a role.

    I'm just writing out various thoughts on the subject here; this isn't necessarily a wish list or what I expect to see in the pack. I would like to see a spell system that could be extended to incorporate any of this without having to do a major rewrite. :)
     
    Hans, kurotatsu and Tryz like this.
  49. ISH_the_Creator

    ISH_the_Creator

    Joined:
    May 8, 2013
    Posts:
    165

    How about random animations, For example there is Cast magic to monster, Heal magic to player, Cast other magic

    To monster in an area. But make the same way your doing the packs. Were you can add your own magic spells

    bought from asset store or made in Maya or Houdini. Sliders of damage modifiers.
     
    Tryz likes this.
  50. ISH_the_Creator

    ISH_the_Creator

    Joined:
    May 8, 2013
    Posts:
    165
    Ok this is old school but why not

     
    Tryz likes this.