Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Motion Controller

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

  1. daniel5383

    daniel5383

    Joined:
    Dec 27, 2017
    Posts:
    8
    I think it has something to do with the build of the demo im making rather than the motion controller itself. I pulled the other 3rd person prefab into my scene from another controller and it wouldn't work. So I created a new project and brought that same prefab into the scene and it works fine. So im thinking that its something else im missing.
     
  2. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957
    @daniel5383 - I can take a look if you zip up a small project in which you're seeing the issue with the input and send me a link via PM.
     
  3. Subliminum

    Subliminum

    Joined:
    Nov 9, 2017
    Posts:
    97
    Hmm so it could be that your Motion Controller is not receiving the input to navigate up or down. Are you using an Input Source? You will need to ensure that either your Unity Input Settings or Input Source are triggering a Action Alias that is registered by your Motion.
    With Unity Input, you will need a scene GameObject with a UnityInputSource (Example in Swimming Demo) Component and the MC should detect it on Play.
    Help.png

    This screenshot illustrates correct MC settings. Your MC should be receiving Input and have Alias' for Up and Down that match the Unity Input Settings. You can setup the default Input Settings from here, or add them manually. Input.png

    Hopefully this explains how to get it all working :)

    Subliminum.
     
  4. FargleBargle

    FargleBargle

    Joined:
    Oct 15, 2011
    Posts:
    772
    @daniel5383: First and foremost, did you try the swimming demo included with the swimming motion pack? You need to follow all of the setup steps - meaning import the Mixamo animations, copy over the meta files from the Extras folder, open the demo scene, and do the pack setup. After that, the demo character and input controls should be properly set up, and the Q and E buttons should work. If you use an X-box controller, you'll probably need to manually add whichever buttons you wish to use for up and down motion to the up and down inputs, but the keyboard controls should work fine after following the setup steps in the manual.

    Once you have the demo working, you should be able to swap out the Mixamo animations for your own, and if any problems come up at this point, they should be easier to pinpoint, knowing that the base setup works. As for more elaborate movements - pitching the character up and down as they swim for instance - this is definitely possible, but will require different animations, or additional code in your swimming script. If you don't want to mess with the base script, you can create a separate pitch control script, that tilts the character when you press the up and down buttons while swimming.
     
    Subliminum likes this.
  5. daniel5383

    daniel5383

    Joined:
    Dec 27, 2017
    Posts:
    8
    Is there a way to do that without sending you the whole project? Its at like 6gb right now lol
     
  6. daniel5383

    daniel5383

    Joined:
    Dec 27, 2017
    Posts:
    8
    Thanks for all of the help with the screenshots but I went in and checked my settings and they match to exactly what you have. I also went in and checked in the input settings and went to the move up and move down and made sure the e and q buttons were on there. There wasnt an axis set so i thought maybe that was the problem and i checked the Y axis but still nothing :(
     
  7. daniel5383

    daniel5383

    Joined:
    Dec 27, 2017
    Posts:
    8
    I am going to try this now but I really think its something else because like I said before I brought in another prefab that had an existing third person controller attached to it and it wouldn't go up and down. I went and took that same prefab into an brand new project and it worked. So somehow through something in my project, something got changed that is breaking the input in some way I think. I appreciate all of yalls help for real
     
  8. rubble1

    rubble1

    Joined:
    Apr 25, 2010
    Posts:
    84
    I would like to use the NPC controller on the Sword and Shield pack. Is there a simple way to get it to select a new target at runtime? It only seems to work for me if I have it set up before playing.
     
  9. Yerkisk

    Yerkisk

    Joined:
    Jul 28, 2015
    Posts:
    38
    Hello everyone. I've just bought all of Ootii's great assets, but I want to use them in an unconventional way. We're running an authoritative server in batch mode which means no animations are running on it. We basically sends information to the clients as to when to play, for example, the attack or block animations, and of course we don't expect the motions to do any other fancy stuff like lowering the player's health or even checking if the attack was blocked or anything like that. For references, even player actions are not decided on the player-side: Players send their requests to the server, and the server sends back the corresponding animation information to play.

    Now what we're wondering is, what would be the best use of the assets that we could do in this case? Should we simply add the motion controller and actor core to players and npcs and when they receive the 'attack information' from the server generate a combat message to order them to play the attack animation based on their current equipped items? Remove most (if not all) events called by the animations as they should not be processing anything more than playing their animations? Or should we just forgo using the assets at all...

    We're not using UNet, and we cannot 'sync' the parameters as in Tim's videos since there are no animator or even instantiated prefabs on the server. Basically all we want to do is use Ootii's animation controller with all the smooth animations and parameters but based on input that will come from a server rather than the player.

    Any idea is welcome!

    Thanks
     
  10. lolaswift

    lolaswift

    Joined:
    Jan 10, 2019
    Posts:
    151
    dear community, I have some questions and I need your help.
    1.Do I need to buy any AI package for NPC enemies? If so, which one can you recommend, Behavior designer, Emerald AI, etc?

    2.And I'd like to some female movement animations from the Asset store to use with the Motion controller. Possible to replace the default walking, running animations? I sent an email to Tim very long time ago but no response.

    3. Has anyone compared Ootii's packages to Invectors? I own Ootii's but Invector's assets are onsale now. Not sure if it's worth of giving it a try as well.

    Any help would be much appreciated!
     
    Last edited: Dec 1, 2019
  11. rubble1

    rubble1

    Joined:
    Apr 25, 2010
    Posts:
    84
    Hey lolaswift. I've not tried invector's system yet, so I can't really comment. I specifically bought the Motion controller to replace animations and customize movement. So far, I've not been disappointed. All the character systems should have some way of swapping out animations, that shouldn't be a big problem. This one lets you get in there and completely redefine the behavior of those animations if you want, which is why I chose it over the some of the others at the time. You can do male, female, or even non humanoid as long as you have the animations for it.
    The system is very modular too, so you can add only the things you need. That said, the only thing is, you really do have to roll up your sleeves and do a bit of work with the code (which isn't super hard once you get the hang of it) customizing it if what you want isn't already there. And there's a lot there as it is. Most of times, you might just use some of the included motions.
    There's now a character wizard, which is a great help speeding up the setup when you're dealing with the motion packs.
    As far as AI, I've not tried it yet. I'd love to hear other's thoughts on the integrations, and which of the systems is better. As mentioned in my post above, there's some basic AI included, though you might need to extend it to fit your needs.
     
    FargleBargle and lolaswift like this.
  12. christougher

    christougher

    Joined:
    Mar 6, 2015
    Posts:
    558
    There are some integration packages for both node canvas and behavior designer on Ootii's website
     
    lolaswift likes this.
  13. lolaswift

    lolaswift

    Joined:
    Jan 10, 2019
    Posts:
    151
    Hi Rubble1, many many thanks for your help. Really appreciated!!
     
  14. lolaswift

    lolaswift

    Joined:
    Jan 10, 2019
    Posts:
    151
    Found it https://ootiigames.com/?p=756
    Many many thanks, christougher
     
  15. xoodZ

    xoodZ

    Joined:
    Jan 8, 2018
    Posts:
    17
    Hello. I ask for help.
    I set up a character who uses AI, PuppetMaster and a MotionController. For AI, I use NodeCanvas (NavMesh). Patrol action is "NavigateTo". In ActorController use flag "UseTransform". The character patrols well - walks, jumps, all animations work.
    There is one problem that I can’t solve.
    At the moment when the character is knocked down (with the help of the PuppetMaster), I turn off the actor and the motion controller by code. Also I stop NavMesh and pause GraphOwner (NodeCanvas):
    motionController.enabled = false;
    actorController.enabled = false;
    navMesh.isStopped = true;
    graphOwner.PauseBehaviour();

    When the doll aligns with the animation and the GetUp animation ends, I turn on the motion controller, actor, run NavMesh and run GraphOwner.
    At the same time, the character continues to move around the scene (test scene with patrole), but the walking animation is not play. The animation begins to play after the jump or after the fall (some points in the patrol on the hills) - the animation of the jump plays and after that the animation of the walk plays too. Until I knock the character down again...

    Do I need to perform any additional actions after turning on the motion controller for the character controlled by AI?
    Maybe some transitions in the animation controller are missing? I configured the animation of the rise and the transitions from them to rest and movement, in the controller I see the transitions.
    Maybe I'm missing something important?
    Why does the character walk after the jump, and after GetUp and turning on the controller+actor - remains in the animation IdleState?

    My controller is very simple (non humanoid npc with few animations). In the controller I use only BasicIdle-SM, BasicWalkRunPivot-SM, BasicJump-SM and states for PuppetMaster. Im trying to create transitions from the animation of GetUp to the IdlePose and to the states BasicIdle-SM, BasicWalkRunPivot-SM - does not work equally.
     

    Attached Files:

    Last edited: Dec 7, 2019
    ledshok likes this.
  16. xoodZ

    xoodZ

    Joined:
    Jan 8, 2018
    Posts:
    17
    I found a solution.
    Enable of an Actor must be done through an internal property, as well as explicitly enabling UseTransforms. This is how it works for me:
    Code (CSharp):
    1.         public void OnLoseBalance()
    2.         {
    3.             motionController.enabled = false;
    4.             actorController.IsEnabled = false;
    5.             actorController.UseTransformPosition = false;
    6. ......
    7.         }
    8.  
    9.         public void OnRegainBalance()
    10.         {
    11.             motionController.enabled = true;
    12.             actorController.IsEnabled = true;
    13.             actorController.UseTransformPosition = true;
    14. .........
    15.         }
     
    ledshok and TeagansDad like this.
  17. pushingpandas

    pushingpandas

    Joined:
    Jan 12, 2013
    Posts:
    1,419
    Hello, dumb question. Where can I set the walkspeed???
     
  18. FarNiche

    FarNiche

    Joined:
    Jul 24, 2014
    Posts:
    15
    Thank you very much. I'm using Unity Personal 2019.2.15f1 with all the ootii packages installed and every time I tried to do a quick Build & Run... no joy. Moving that "using UnityEditor.Animations;" namespace between the conditional #if works. Now... to figure out how to get a crossbow (rifle) and a wand (pistol) switched out. Thanks again. ootii Build and Run Animation Compiler Error.png
     
  19. Dermestes

    Dermestes

    Joined:
    Aug 9, 2015
    Posts:
    13
    I am trying to replace the Idle animations completely depending on what weapon is currently equipped but I get random short frames of the stock IdlePose. What is the best way to approach completely removing the stock IdlePose when a weapon is equipped? Anyone have a good example/tutorial?

    Thanks,
    Dermestes
     
  20. LumoKvin

    LumoKvin

    Joined:
    Sep 28, 2019
    Posts:
    195
    I tried adding my own animations, but it is not working. I was following this tutorial:
    https://www.youtube.com/watch?v=5_IgCynsNnE


    The normal WalkRunPivot works, but once I swap out animations, the character no longer moves. https://imgur.com/JcfsTw6


    Capture.PNG Capture2.PNG
     
  21. lolaswift

    lolaswift

    Joined:
    Jan 10, 2019
    Posts:
    151
    does the developer still visit the thread and provide support by email?
     
  22. KeithBrown

    KeithBrown

    Joined:
    Apr 1, 2017
    Posts:
    191
    Tim is currently working out of the country and replies on the weekends when he can. TeagansDad is helping out and providing support in the meantime. I believe that Tim still answers emails but on the weekend until his assignment overseas is finished. I believe he is working on a game for Nintendo but I could be wrong.
     
    lolaswift likes this.
  23. p_hergott

    p_hergott

    Joined:
    May 7, 2018
    Posts:
    414
    I have the motions, s there a lot easy way to implement melee hits while using a rifle. (I have most of the ootii packs fyi)
     
  24. lolaswift

    lolaswift

    Joined:
    Jan 10, 2019
    Posts:
    151
    Many thanks for the info. Tim's assets are really awesome. I hope he will have more time working on updating them soon. Like the shooter module, still beta, I guess.
     
  25. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957

    Do the animations use root motion data, and have you configured all of the import settings correctly?

    If you zip up a small project and send me the link via PM, I'll have a look at it for you.
     
    lolaswift likes this.
  26. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957
    Do you mean getting hit by a melee weapon or using the rifle as a melee weapon?
     
  27. lolaswift

    lolaswift

    Joined:
    Jan 10, 2019
    Posts:
    151
    @TeagansDad I bought the motion controller and I'm thinking about getting some plugins. I read from the description of the shooter modules saying that it works with the ootii's damage system. May I ask which one is the ootii's damage system? thx btw, for supporting the community!
     
  28. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957
    @lolaswift - ootii's damage system isn't a separate asset; it's simply the system used in the three combat-related motion packs (Shooter, Archery, Sword and Shield). It's fairly basic but extensible with a bit of coding.
     
    lolaswift likes this.
  29. p_hergott

    p_hergott

    Joined:
    May 7, 2018
    Posts:
    414
    like hitting with the rifle. smack
    em baddies with the butt end of a gun just seems satisfying
     
  30. lolaswift

    lolaswift

    Joined:
    Jan 10, 2019
    Posts:
    151
    thx!
     
  31. shooob

    shooob

    Joined:
    Dec 1, 2016
    Posts:
    6
    Hello!

    I hate asking such open ended questions, but I am stuck on getting the interactive object demo objects working.

    I have had a lot of success getting a lot of other things in the motion controller working and working well together (well so far HA!)

    What is happening is that when I drop it in the world, follow the tutorials, and documentation nothing happens. Nothing highlights, nothing happens when I use the interact button, and I do not collide with it (tho I can fix that by making sure collision is set for the right layer). I feel like there is something really basic I am not doing. I am pretty new to Unity so it is possible I just am not doing basic stuff.

    What I have done so far (using provided Door sample object and interaction cores):
    1. Added Basic Interaction (default settings... all layers are on)
    2. Added Basic Walk, Run, Strafe (Named it Controlled Walk, cleared activation Alias and disabled it)
    3. I had to change the default materials on all elements (they do not work in HDRP)
    4. Changed the Raycast Collider to the Door (kinda guessing on that one)
      1. I tried using the object "RaycastArea" which is the door handle, but it was so small I wanted to try something bigger (again a Guess)
    At this point I expected that in the least it would highlight... but I got nothing.

    Newb questions:
    1. In unity do I have to do anything to get Tigger Volumes to be recognized? (I remember having to build geometry in other editors to have things like this work)
    2. Any chance my crosshair layer is blocking the raycast?
    3. Can I visualize the raycast so I can atleast see if it is happening?
    thanks again for any, slap on the forehead stuff. Really thanks in general. This is a great set of tools and the first dead stop I have had. I am an artist by trade so some of this is newish to me.
     
  32. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957
    @shooob - if you look at the scene named __Quickstart Demo Template and run the Character Wizard to create a character (preferably with the Archery or Shooter pack included, so that the crosshair is active and configured), you should have an example of the interactions set up in a more complex scene with a character that has more than the most basic configuration.

    It's been a while since I set up any of the interaction components, so the best I can do for the moment is to refer you to this demo scene that I know works properly to compare with.

    I know I've run into this issue before, but I can't remember what the problem was.

    You can also zip up a small project and send to me via PM and I'll have a look when I get the chance.
     
  33. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957
    You'll need the Sword and Shield Motion Pack, which includes the melee combat system. Using the sword as a model, you should be able to set up the rifle as a melee weapon. You'll need to specify a different input alias for the Basic Melee Attack motion, as by default it will use the same button as shooting.

    The Basic Melee Attack motion might actually require the character to be in a specific stance (COMBAT_MELEE I believe), which will need a bit of a workaround. Might need to build a new motion based on Basic Melee Attack that activates from the ranged combat stance.

    After the holidays, I'll take a longer look at this and see about modifying Basic Melee Attack to make it flexible enough to support this use case (if it doesn't currently; I don't think it does but I could be mistaken).
     
  34. p_hergott

    p_hergott

    Joined:
    May 7, 2018
    Posts:
    414
    Right on. Ill delv into that and play
     
  35. shooob

    shooob

    Joined:
    Dec 1, 2016
    Posts:
    6
    thanks for the response. I'll take a look with that configuration.
     
  36. KeithBrown

    KeithBrown

    Joined:
    Apr 1, 2017
    Posts:
    191
    Did you set the IsTrigger flag?
     
  37. shooob

    shooob

    Joined:
    Dec 1, 2016
    Posts:
    6
    yes sir... thanks for reminding me to check
     
  38. DJ_JW

    DJ_JW

    Joined:
    Apr 26, 2015
    Posts:
    24
    I have noticed that when walking up to a wall my character doesn't stop walking and just keeps running the walking animation. I had thought that the collision system stopped the character from walking when against a collider - is this correct?
    I have the layer of the walls set to Default and the collision layer on Actor as default so figure it should work unless I misunderstood the functionality.
    Has anyone else noticed this or know how to make the MC stop moving when up against a wall (and trying to walk).
     
  39. Salja

    Salja

    Joined:
    Mar 23, 2017
    Posts:
    353
    Go to the climb motion and click at the small blue icon after you click to recreate/create animation state button. The issue you has is about missing animation state in your animation controller for the climb motion
     
  40. Salja

    Salja

    Joined:
    Mar 23, 2017
    Posts:
    353
    If anyone can still use the mobile input, I have coded one especially for ootii and Unity Crossplatform

    PS: The Mobile Input Source Script is in my unitypackages

    Setup Video

    https://youtu.be/88mBRowtrd4

    I have over 100 ootii custom scripts and if I have the time I will offer a small download page for all my things
     

    Attached Files:

    lolaswift, drcfrx, rubble1 and 2 others like this.
  41. Salja

    Salja

    Joined:
    Mar 23, 2017
    Posts:
    353
    if someone still looking for EmeraldAI Integration you can use my easy Integration found here
     
    lolaswift likes this.
  42. KeithBrown

    KeithBrown

    Joined:
    Apr 1, 2017
    Posts:
    191
    @Salja If you don't mind sharing, I would be interested in seeing the scripts. A simple package would suffice for me.
     
    lolaswift likes this.
  43. Salja

    Salja

    Joined:
    Mar 23, 2017
    Posts:
    353
    I will post it as soon as I find the time to sort it and write instructions on how to do it, otherwise there will be too much support. I'm still not sure if I might put some of it in the store, there is a lot of work behind it but I'll see

    here is a list 1 of 10 I have to see it all: D
    Screenshot_3.png
     
    Last edited: Dec 30, 2019
    lolaswift and rubble1 like this.
  44. lolaswift

    lolaswift

    Joined:
    Jan 10, 2019
    Posts:
    151
    You're a hero! Many thx in advance.
     
  45. indra-p

    indra-p

    Joined:
    Mar 12, 2013
    Posts:
    38
  46. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957
    @indra-p - That set of motions for MAP is super old now. I've got a newer version that I've been working on that uses the "Basic" set of motions that are designed to make it easier to add different animations while using the same logic to control them.

    I'll try and post a link for you later in the week, after I make sure that it still works correctly. :)
     
  47. Yerkisk

    Yerkisk

    Joined:
    Jul 28, 2015
    Posts:
    38
    Hello, I'm trying to create some 'looped' spellcasting animations (start, loop, end), but for some reasons when the motion reaches the loop, it seems to reactivate the motion and it goes back at playing the start cast animation.

    The controller is pretty simple:
    upload_2020-1-5_15-44-31.png

    The transition from Start to Loop has no Condition;

    The transition from Loop to End has one condition :
    upload_2020-1-5_15-45-43.png

    And the transition from End to Idle has no condition.

    The Start and End animations are non-looped animations, while the Loop animation is a looping animation.

    The LoopedAction in code has very little, but here are the main functions :

    Code (CSharp):
    1. // Enum values for the motion
    2.         public const int PHASE_UNKNOWN = 0;
    3.         public const int PHASE_START = 4200;
    4.         public const int PHASE_END = 4205;
    5.  
    6. ...
    7.  
    8. public override bool TestActivate()
    9.         {
    10.             if (!mIsStartable)
    11.             {
    12.                 return false;
    13.             }
    14.  
    15.             if (!mMotionController.IsGrounded) { return false; }
    16.  
    17.             // Check if we've been activated
    18.             if (_ActionAlias.Length > 0 && mMotionController._InputSource != null)
    19.             {
    20.                 if (mMotionController._InputSource.IsJustPressed(_ActionAlias))
    21.                 {
    22.                     return true;
    23.                 }
    24.             }
    25.  
    26.             return false;
    27.         }
    28.  
    29. public override bool TestUpdate()
    30.         {
    31.             if (mIsActivatedFrame) { return true; }
    32.  
    33.             // If we've reached the exit state, leave. The delay is to ensure that we're not in an old motion's exit state
    34.             if (mAge > 0.2f && mMotionController.State.AnimatorStates[mMotionLayer._AnimatorLayerIndex].StateInfo.IsTag("Exit"))
    35.             {
    36.                 return false;
    37.             }
    38.  
    39.             return true;
    40.         }
    41.  
    42. public override bool Activate(MotionControllerMotion rPrevMotion)
    43.         {
    44.             // Tell the animator to start your animations
    45.             mMotionController.SetAnimatorMotionPhase(mMotionLayer.AnimatorLayerIndex, PHASE_START, mParameter, true);
    46.  
    47.             // Return
    48.             return base.Activate(rPrevMotion);
    49.         }
    50.  
    51. public void FinishCasting()
    52.         {
    53.             mMotionController.SetAnimatorMotionPhase(mMotionLayer.AnimatorLayerIndex, PHASE_END, mParameter, false);
    54.         }
    I manually call FinishCasting() externally after a specific amount of time, but anyway the problem is prior to that.

    The motion itself is activated manually by code using the following code, and I've verified that this code only run once :

    Code (CSharp):
    1. LoopedAction motion = mMotionController.GetMotion<LoopedAction>();
    2.             if (motion != null)
    3.             {
    4.                 mMotionController.ActivateMotion(motion, parameter);
    5.             }
    So It has to be something in the LoopedAction code mentioned above, but I can't figure out what it is. It shouldn't reactivate the motion as the TestActivate has a check for the ActionAlias to see If it was just pressed.

    Any reasons that you guys can see as of why it would automatically return to the AnyState -> Start transition after playing the Loop animation? I can't see any difference in the way I'm doing it and the BasicSpellcasting code...or at least none that would force it to return to the start. Thanks.
     
  48. indra-p

    indra-p

    Joined:
    Mar 12, 2013
    Posts:
    38
    Cool thanks.. btw it is diffucult to add lean movement when turning? the animation files exist in the kubold's pack.. i think will be cool to have that feature..
     
  49. indra-p

    indra-p

    Joined:
    Mar 12, 2013
    Posts:
    38
    i got another issue.. i cant even build the game.
     

    Attached Files:

  50. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957
    Did it just start doing this, or has it been showing this error all along?

    I'll check the current Asset Store version when I have a chance.

    Is it possible that there is another class named "AnimationUtility" within the global namespace in the project?