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. eagleeyez

    eagleeyez

    Joined:
    Mar 21, 2013
    Posts:
    406
    Thanks for your quick reply. I'm looking forward to the goblin tutorial and I have also tried out the Behavior Designer package and had no problems with it.
    Q: will I be able to do stuff with that later like A.I. for Mecanim?

    Q: Have you tried Playmaker yet? BD supports that too.
    If over time, we can get more and more of all the good assets combining with PM, I am sure we could at some pint reach a state of very little coding and great game results.

    My first finished game is going to combine AdentureCreator, BehaivorDesigner, PlayMaker, MotionController, AdventureCamera, SubstanceDatabase, ProBundle, DialougeSystems, Daikon, Score Flash, Shader Forge, all from UMA and Arteria3D, and the list goes on and on, but already a lot is working together.

    If you have loads of assets like me, then try out Grab yer assets, you will never want to be without it.

    And take a look at this free from Unity
    Unity Remote 4
    https://www.assetstore.unity3d.com/en/#!/content/18106

    It is only for 4.5, so that means we will be getting 4.5 very soon.
     
  2. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Yes. Justin (the creator of BD) and I are currently working on a goblin simulator so you can see how you can use both BD and MC to control NPCs. For example, while walking around goblins will climb obstacles in their way and jump down off of ledges.

    His latest version also has support for direct control of some Mecanim features as well.

    For the game we're making at ootii, I'm planning on having all the AI created this way.

    I haven't. I've had several people ask for me to support it, but I've never used PM and I'm not sure what kind of time frame it's going to take. Unfortunate, time is my most limited resource.

    This is what's keeping me with Unity. I've worked with UDK and Crytek before and with their recent price drops, it makes it tempting to move over there. But the Asset store is just invaluable. Not only as a source of revenue for me, but for plug-and-play tools too.

    On that point, your video of GYA was great. Guess what I'm buying next. :)
     
  3. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    As promised, I just posted a tutorial showing you how to create a motion. I spend about 5 minutes explaining how the motion controller works and about 15 minutes creating the actual motion.

    Let me know what you think.

     
  4. kurotatsu

    kurotatsu

    Joined:
    May 10, 2012
    Posts:
    588
    Excellent video Tim.

    I'll see if I can follow your format a little closer from here on out.
     
  5. blockcipher

    blockcipher

    Joined:
    Jul 4, 2013
    Posts:
    19
    Wierd S*** man. I did your exact steps on a brand new project and still the same error. Is anyone else getting this while testing using BD? Has anyone tried it yet? Its not a real big deal (if its just me) .. I was just curious how the BT was set up.

    Excellent video btw ;)

    Oh one more thing, you forgot to "collapse" your probuilder cube in to a geometry object (in the bd scene).. luckily i had a missing script detector running and noticed the pb_Entity@

    This is of course unrelated to the error, just letting you know.
     
    Last edited: May 28, 2014
  6. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Thanks guys. Yeah, making the videos wasn't too bad. I wasn't so sure about how they'd come out. Glad you liked them.

    Can you send me that project on Dropbox? I'm curious if it will just work for me or if I'll see the same issue.


    haha, yeah. I love their tools. I noticed when I was testing your bug I had a giant purple box. I'll clean it up for the next release.
     
  7. blockcipher

    blockcipher

    Joined:
    Jul 4, 2013
    Posts:
    19

    They do have great prototyping tools for sure!

    Project is here buddy:
    link removed by moderator

    Note it is RAR 5.0 compression. Thanks man.
     
  8. superpig

    superpig

    Drink more water! Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,649
    blockcypher, you should send that link in PM - otherwise anyone could download your project and get the Motion Controller assets out of it.
     
  9. blockcipher

    blockcipher

    Joined:
    Jul 4, 2013
    Posts:
    19
    my bad ... its been a long day ... thanks superpig
     
  10. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    haha... Thanks SuperPig!
     
  11. eagleeyez

    eagleeyez

    Joined:
    Mar 21, 2013
    Posts:
    406
    Love the videos and in retrospect to some here that say don’t do videos! I can only say 2 words to those people which I will not repeat here. Videos help to understand some explanations that are not always obvious in docs. Of course doc are important and even after watching such a video I usually go back to the docs and say, “AhHa”, “Eureka.”

    You explain everything very well with a very sympathetic voice, so keep it up Tim.

    It has given me a few ideas, how MC should be. This is going to be relatively long and very complicated so I will sit down over the weekend and write you a PM.

    But in the end it will make everything much easier that is if it can be done at all.


    “We will see”, said the blind man to the death man and the death man said, “What?”
     
  12. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Thanks EagleEyez.

    Looking forward to your thoughts (tim@ootii.com is the best for me).
     
  13. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    I opened your project and got the same errors you did. I'm wondering if it has something to do with the version of BD that you had.

    Here's what I did to get past the issue:
    1. Deleted the Behavior Designer folder from your project.
    2. Deleted the Gizmos folder from your project.
    3. Downloaded and installed the latest Behavior Designer.
    4. Closed the project.
    5. Reopened the project.

    Then, I could get to the behavior tree and no errors.


    The error you were getting was referencing something in the BD dll. You may want to send the project to Justin at Opsive and see what he says. He has the Motion Controller so you're fine to send him the same thing you sent me.
     
  14. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Today I've got TWO videos for you! :)

    This first video shows how you can package up and share a motions you create.


    This second video shows how to use a motion someone else has created and shared.


    I've also started a really basic repository for motions people are willing to share. You can get to it on my website:
    http://www.ootii.com/UnityMotions
     
  15. dl_studios

    dl_studios

    Joined:
    Oct 14, 2012
    Posts:
    76
    Hi Tim,

    I've been using your motion controller with your adventure camera on ios. Many of the previous trigger detection issues were fixed with the latest update. Thanks. However the toe "slip" animation still runs when he hits the edge of a trigger with his feet.

    There is also a problem, mostly prevalent on ios, but once in a while crops up on desktop: That is, whenever the character goes through a trigger collider the camera gets disoriented. It will often flip 180 degrees, and sometimes just wiggs out completely and zooms out about 1000m then back in again. There are times when this will happen when I spawn new game objects. I'm not sure what is going on. This even happens with triggers on the ignoreraycast layer.

    Any ideas would be great. Thanks.
     
  16. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    I think I might know what this is. I'll look into it.

    Weird. I'll try to reproduce it. Is there any chance you can PM or email (tim@ootii.com) a small project showing this happening? It will help me narrow this down quicker.

    Thanks
     
  17. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
  18. MikeUpchat

    MikeUpchat

    Joined:
    Sep 24, 2010
    Posts:
    1,056
    Great looking system, quick question would it work alongside an IK system such Final IK?
     
  19. Tryz

    Tryz

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

    I haven't tried FinalIK, but I do have some motions working with Unity's IK solution.

    I wouldn't expect there to be a problem as I'm not trying to control the bones directly. Instead, the motions are managing the flow of animations within the Animator. So as long as FinalIK can blend or override the normal animations, you should be fine.

    Each motion has an Activate(), Deactivate(), and UpdateMotion() function that you'd probably tap into in order to control the IK.

    Hope that helps,
    Tim
     
  20. kurotatsu

    kurotatsu

    Joined:
    May 10, 2012
    Posts:
    588
  21. dl_studios

    dl_studios

    Joined:
    Oct 14, 2012
    Posts:
    76
    Hi Tim,

    I figured out how to reproduce the camera wig out error. It's when ever there is a frame rate drop. On ios it's obviously a lot easier for this to happen. To reproduce in editor just attach this script to a trigger and walk the character rig through.
     

    Attached Files:

  22. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Cool. I'll check this out and let you know what happens.

    Thanks!
     
  23. tonywalsh

    tonywalsh

    Joined:
    Jun 4, 2014
    Posts:
    16
    Hi folks, I am working on a 2.5D side-scroller in my off hours, and I've combined Motion Controller with the camera from the Physics Platformer Kit. This has given me a side-scrolling camera, but I still need to constrain the avatar so it behaves typically for a side-scroller.

    Tim already gave me some camera tips (great support, thx Tim!) but I thought I'd continue my thinking here on the forum in case anyone else might benefit -- anyone got any ideas on how to prevent the avatar from having a free range of movement and act more like a side-scrolling character? I'm not a programmer, but can follow instructions pretty well :D
     
  24. kurotatsu

    kurotatsu

    Joined:
    May 10, 2012
    Posts:
    588
    Nvm, the InControl implementation. I got it working.

    Still in the market for a doublejump unfortunately(I'm working on one currently, though it's freezing during the ledge/hang.).
     
  25. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Thanks for this. Always helps to be able to reproduce an issue consistently and your script does that.

    I found when I disable 'Use Smooth Movement' on the camera this doesn't happen. Can you confirm that's the case for iOS too?

    It doesn't surprise me that with Use Smooth Movement on there's drag on the camera. That's what it does and the low frame rate causes it to have to catch up. However, having the character do a 180 (which is what's happening to me) isn't right. It may take a couple of days, but I'll figure out what's going on.

    Thanks!
     
  26. MarkRMichaels

    MarkRMichaels

    Joined:
    Oct 1, 2013
    Posts:
    1
    When I use
    "string lState = mController.GetAnimatorStateName(mAnimatorLayerIndex);"
    I often end up with an empty string, but seemingly without changing anything it stats to return the expected. Any idea why specifically this might happen?
     
  27. Tryz

    Tryz

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

    I haven't seen this before and haven't been able to reproduce it in the tests I've made. Are you sure you're calling 'AddAnimatorName' for all the states and transitions you're trying to look at?

    For example:


    mController.AddAnimatorName("Jump-SM.JumpRise");
    mController.AddAnimatorName("Jump-SM.JumpRise -> Jump-SM.JumpRiseToTop");


    I'll keep trying, but until I reproduce it I'm a bit stuck.
     
  28. 3

    3

    Joined:
    Sep 16, 2012
    Posts:
    387
    Question, if someone wants to share their motions, would they be allowed to via the asset store? I would love to purchase a fully completed character,
     
  29. Tryz

    Tryz

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

    As long as you don't deliver any of the Motion Controller code or animations, you should be fine. You'd just have to state in the description that they need to own the Motion Controller to use your package.

    That said, I don't know if Unity itself has any rules about packs or add-ons, but I don't think so. I know Behavior Designer has 'packs' as well as the UMA project.

    Hope that helps,
    Tim
     
  30. Ixtabay

    Ixtabay

    Joined:
    Sep 3, 2013
    Posts:
    1
    Hi Tim,

    I purchased both your Motion Controller and the Adventure Camera and Rig. I emailed you on this, but also want to paste it here in case someone else has the same interest.

    The controller I need must move more like a traditional MMORPG controller. Here is a demo:

    http://clutch.net/MMORPG_controller_demo.html

    If you could help me get started on making the changes, I may be able to figure out the rest.

    The changes I need are:

    1) Turning in place added
    2) Strafe when running (q, e keys) added (holding down right mouse and pressing a,d also strafes)
    3) Mouse wheel to zoom in/out
    -- I do like how your zoom in puts the character to the left rather than zooming into the head of the player

    4) Holding down the right mouse button engages mouse look
    5) Holding down the left mouse button swings camera around player
    6) Unless a mouse button is held down, mouse movement does not affect character or camera. (needs to be free for clicking game objects, etc)

    Many thanks,
    Tom
     
  31. dl_studios

    dl_studios

    Joined:
    Oct 14, 2012
    Posts:
    76
    Hi Tim,

    I can confirm that on ios when Use Smooth Movement is false the problem is fixed. Thanks for working on this!
     
  32. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Thanks DL. I'm still looking at why it's happening with Smooth Movement on, but this week is going to be hit or miss for me. :)
     
  33. Tryz

    Tryz

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

    I don't own the MMORPG controller, but I did check out the video. I'll help how I can.

    Let's take them one at a time...easiest first:

    6. Unless a mouse button is held down, mouse movement does not affect character or camera.
    That's the way it's working now. No changes needed

    5. Camera orbits player when left mouse button is pressed

    All the input controls are handled in the 'Scripts/ootii/MotionController/Input/InputManager.cs' file. Right now, I use the right mouse button for camera orbit. You can change that in the 'ViewX' and 'ViewY' properites (lines 85 and 110).

    4. Holding down the right mouse button engages mouse look
    This one is a little tricky, but doable. In fact, I do something similar when you hold the middle-mouse-button + right-mouse-button. Basically, the camera goes into First Person Mode and rotates the avatar for you.

    Look in the AdventureRig.cs file. In the PostControllerLateUpdate() function, you'll see the camera calls into the Motion Controller's FaceCameraForward(). This is what rotates the character in the direction of the camera.

    You just need to enable it how you see fit.

    1. Turning in place
    This one is similar to #4. You could use the FaceCameraForward() or you can look in the function and see how I'm doing it. Basically I'm just getting the angular difference between the camera's forward and the avatar's forward and rotating the avatar to match the camera.

    3. Mouse wheel to zoom in/out
    I don't have code for this, but I don't think it would be too tough to add. You're either moving the camera or changing the FOV. I'd put that in the AdventureRig.cs in the Update() function. Unfortunately, I don't have much more advice than that.

    2. Strafe when running
    This feature would be based on the motion you're creating. I actually have something similar in the Sneak motion. If you go into 'sneak' mode, you'll see he strafes left and right. You should be able to follow that code and look at the animator to reproduce it.

    The top ones should be fairly easy changes. I hope that helps!
     
  34. kurotatsu

    kurotatsu

    Joined:
    May 10, 2012
    Posts:
    588
    How about exposing the force variable used for the jump in the inspector.

    And I also have a bug when the character is standing on a narrow gap, they then become uncontrollable from that moment forward.

    A pic of where in the debug lvl this happens:

     
  35. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Do you mean just read-only (since the force is calculate at run-time using the Impulse + mass)?

    I'll look into that bug once I get the chance. I'll have limited availability for the next week.
     
  36. kurotatsu

    kurotatsu

    Joined:
    May 10, 2012
    Posts:
    588
    Ic, just was thinking of adding a charging super jump which would have more force than the original jump.
     
  37. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Gotcha. Just increase the impulse (you can do that at run-time too). This way it all works as expected.
     
  38. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    A quick question for everyone.

    When Unity does an update (say from 4.4 to 4.5), do you all immediately update? I want to move to 4.5 because of some new Mecanim features, but I'm worried it would break people using anything less.

    I'm not sure how to manage multiple versions on the Asset Store.
     
  39. kurotatsu

    kurotatsu

    Joined:
    May 10, 2012
    Posts:
    588
    Good question, I'm using Unity 4.5.0f6.

    Guess just have everyone post their version.
     
  40. S-0-L-0

    S-0-L-0

    Joined:
    Nov 9, 2012
    Posts:
    163
    Looking to hire an experienced programmer/animator to do a Top Down Shooter Prototype using ooti Motion Controller & Adventure Camera, please pm me for details.
     
  41. 3

    3

    Joined:
    Sep 16, 2012
    Posts:
    387
    Hey Tim, just wondering, any new motions coming soon?
     
  42. Tryz

    Tryz

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

    Not for a bit. I'm focusing on AI right now and then I'll be getting into combat (think swords, bows, etc). I'll have some new motions then.

    Unfortunately, the AI stuff had me taking some detours. I needed RPG-ish attributes and memory which led to data storage which led to saving & loading games. Now that I've got all that working, I'm back to the actual AI.

    That will be the next release...AI integration, documentation, and videos.

    Side note: The other thing I've been thinking about is porting the Motion Controller to use the new Character Controller Unity has released.

    There just aren't enough hours in the day. :(
     
    Last edited: Jun 17, 2014
  43. TenTickles

    TenTickles

    Joined:
    Nov 17, 2012
    Posts:
    10
    Im curious how the Motion Controller handles root animations, like a jump with root transforms on it? Or an attack that has a forward leap incorporated in the animation itself?

    Interesting, I didnt realize Unity had put out a new Character Controller? Where can I find out more about the changes to this?

    Edit: Oh, one other question. Does it play nice with the Final IK plugin?

    Thanks! This looks impressive!
     
  44. Tryz

    Tryz

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

    Basically I extract the root motion from the currently running animation and store it. Then, I reapply it using the current time step. Doing it this way allows motion builders to modify the root motion in their code (if needed). If you don't modify the root motion, it's applied automatically.

    The new character controller is in the beta asset package Unity put out.

    As far as IK, I've been using Unity IK without a problem. I know another person was using FinalIK and they seemed to be fine. That said, I haven't tried it myself.

    Hope that helps,
    Tim
     
  45. TenTickles

    TenTickles

    Joined:
    Nov 17, 2012
    Posts:
    10
    Thanks Tim!

    I think I'll give your Motion Controller a go :)

    One last question. To what extent would I have access to the source code in the Motion Controller if using it?
    This is mainly so that if there is anything really niche that I want to get done I can try adding it in myself.
     
  46. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Good question.

    If you're just interested in the motions that I included: walk, run, jump, sneak, climb, etc... none.

    You only have to go to the code if you want to add your own motions. Then the complexity of that depends on the complexity of what you're trying to create.

    A simple motion can be created in about 10 minutes.


    On the other hand, I know someone that did a complete (and awesome) set of parkour moves. That took him a couple of weeks with animation and testing.
     
    TenTickles likes this.
  47. negativecap

    negativecap

    Joined:
    Jan 27, 2013
    Posts:
    99
    Tim has an input manager asset that works quite well with the motion controller in my experience... just a thought.
     
  48. kurotatsu

    kurotatsu

    Joined:
    May 10, 2012
    Posts:
    588
    Thx, man. In a couple posts down from that one you'll see I got InControl working.

    I appreciate the reply.

    I'm mostly interested in a double jump, but have just decided to move my project forward without the double.

    Motion Controller seems to have lost some of it's previous momentum due to other obligations(which is Tim's right to pursue.;)), so I'm focusing on other aspects of Voidkeepers design, awaiting future updates.
     
  49. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    I definitely haven't abandoned it, but with only 6 sales a month it doesn't keep the lights on or bellies full. I've tried to get it on the 24 hour sale, but get no response.

    That said, I definitely plan on continuing to improve it. I'm using it for my own game and think it has value.

    I've had to take a detour to add attributes, factions, senses, and memory to my game. This is all in preparation for beefing up the AI. If you're interested, you can follow what I'm doing here:
    http://www.discoverdeep.com/posts

    This isn't specific to the Motion Controller, but I think it's interesting none the less.

    On that note, a simple version of AI (with documentation) is the next release I'll do to the MC.

    (Sorry for the honesty, but I figured everyone deserved to understand the state of things).
     
    Last edited: Jun 23, 2014
  50. kurotatsu

    kurotatsu

    Joined:
    May 10, 2012
    Posts:
    588
    I know the obligations of family, that's for certain(been putting in 16hr days at work the last month.).

    And also know the value of time on ones project is priceless, and as stated above: Your obligations are your right to pursue.

    My only question is have you had any time to look into the bugs reported above, I think my specific one may get solved with the new character controller(I hope.lol).

    By the by, HAPPY BIRTHDAY TIM!!!