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

    Bagnol

    Joined:
    Sep 5, 2013
    Posts:
    169
    @Tryz
    I suppose one possible solution to that is to brand any extra modules that have MC/AC dependencies as specifically MC/AC Modules. So instead of "Dynamic Memory Based AI", it could just be sold as "Motion Controller AI" or "Character Attributes for Motion Controller". Similar to all the expansion modules and kits people have made for Playmaker.

    Obviously that's not always an option if the systems are more deeply rooted in your custom setup, and each game will have it's own attribute system requirements, but if you *are* looking to sell them, it could be an option.

    The AI system is looking pretty amazing btw - can't wait to see some more progress on Hallow's Deep.
     
    hopeful and Tryz like this.
  2. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,399
    hahaha... I like the theme. :)

    That's a good point. In the past, I've tried to make things componentized so you could use MC with or without Mount Points (for example). But, maybe that doesn't always have to be the case.

    Thanks. Hopefully, I'll start moving a bit quicker on it.
     
    Bagnol likes this.
  3. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,399
    I've had some requests for how to do a simpler walk/run motion and I thought this might be a good opportunity for the second tutorial on creating motions.

    You can get it off of the Vault under "NPC Based - Movement Animset Pro Motions" and follow along with this new video:
     
    BackwoodsGaming and Bagnol like this.
  4. florianbepunkt

    florianbepunkt

    Joined:
    Nov 28, 2015
    Posts:
    45
    I would be definitely interested in buying these components if you decide to make assets or seperate asset extensions out of them.

    I like your approach to AI. Having a small modular behaviour trees seems quite interesting… so characters or npcs could learn / train behaviours over time or based on quests.
     
    TeagansDad and Tryz like this.
  5. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,399
    Exactly. :)

    I'm just at the beginning of all this. So, I'm still figuring things out.
     
  6. montyfi

    montyfi

    Joined:
    Aug 3, 2012
    Posts:
    548
    I would be interesting to buy the whole pack, you could create a new asset which will include MC, AC, Camera + promise of future addons.
    Procore, Sectr and others bundled their products together and I think quite successful.
     
  7. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,399
    I saw that Procore did that. With the new "upgrade" approach from Unity, it makes it a little easier too.

    "Promise of future addons" always scares me. Mostly because I don't make enough money to do this full-time. So, I have other commitments that take priority. I think I've done pretty well on support and delivering everything I have promised. That said, I would never want to have someone say, "I paid for it... why haven't you delivered yet?". Too much pressure. ;)

    My philosophy... buy based on what exists and you can't be disappointed by "vapor ware".
     
    TeagansDad, hopeful and montyfi like this.
  8. florianbepunkt

    florianbepunkt

    Joined:
    Nov 28, 2015
    Posts:
    45
    Definitely. The support and help you offer is outstanding. If you decide at some point in the future to pack something of your work on Hallow's Deep in an asset please let me know. I'm sure there are more people that would be interested in this :)
     
    Tryz likes this.
  9. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,399
  10. Dmuse

    Dmuse

    Joined:
    Jan 29, 2016
    Posts:
    4
    Hey @Tryz,

    Purchased the MC2 and like some others, I'm finding it pretty hard to get started with. The user guide does a fair job of going through the components but leaves a lot out as well. Looking at the ACGuide to try to get an understanding of the dataflow from InputSource -->ActorDriver-->ActorController-->Motion Controller and finding it pretty opaque. For instance, looking at the ACGuide you detail the ActionDriver...but there is no ActionDriver component on the prefabs in your scenes for MC. Additionally, the settings for things like impulse and rotation speed which are shown in the Action Driver are actually found in the Motion Controller motions themselves.

    Based on what I'm trying to do, and what I've seen other people talk about on these forums I think it would be helpful to get a tutorial video with a full data flow explanation for creating a actor controller / motion controller using animations that are not using root motion. An explanation for both user input and AI input would be wonderful.

    Some of my questions include:
    • Where are the substate machines getting the values for InputX/InputY for instance? (I assume since you are using root motion they are getting set by the ActionDriver rather than from the inputSource? Maybe?)
    • What the heck do I need to be setting/passing in a motion script to drive the animation states?
    • Where are all of the settings (movement speed, impulse, rotation, InputX/Y) actually set?

    The "NPC Based - Movement Animset Pro Motions" video is a good start, but is not entirely useful for someone who is not already familiar with your framework, and less so if we have to get our own animations and try to plug them in correctly before we can even begin to see how things are actually working. (There are also many scripts missing on objects etc that need to be fixed, making this difficult for someone trying to use the package to understand/get into your code.) There are plenty of simple (and free) animations on the asset store, it would be great if you (or anyone actually) to show setting up, the code to drive all of this in a custom way rather than using the defaults -- which, while they may work for your personal preferences, aren't going to be what most people want. Shoot, even a really simple tutorial with instant snapping when turning (to avoid the complexities of all the blending when trying to learn how things work and what can be tweaked) using the current animation set would be fine.

    Looking forward to getting something working with this...

    Thanks,
    Dmuse
     
  11. Tryz

    Tryz

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

    I think something that might help is just the understanding that the Motion Controller is the driver. That's why things like impulse are in the motions (as needed). Think of each motion as a mini-driver that does a specific thing (idle, walk, jump, climb, etc).

    I get the feeling you didn't see the "Create Motion" and "Create Motion #2" videos that are up on the YouTube channel and that I posted here. I go through the code in pretty gory detail.






    I had hoped page 4 of the User's Guide would explain the relationships you asked about, but maybe a graphic would help. On page 6 of the Motion Builder's Guide I have a graphic, but that may not be enough. Let me know what you think.


    For the specific questions...

    Where are the substate machines getting the values for InputX/InputY for instance?
    All the animator parameters (InputX, InputY, etc) come from the Motion Controller. The MC is the driver and it's reading input values from the Input Source you provide. Then, it's just passing that information through to the animator.

    What the heck do I need to be setting/passing in a motion script to drive the animation states?
    In the Motion Builder's Guide (page 13 and 14) I talk about the Motion Phase ID. I talk about it a lot in the videos too.

    In the end, the Motion Phase ID gets your sub-state machine started. How you drive the animations states after that is really just standard Unity animator stuff and really depends on what you're trying to create. You'll use animator transitions and conditions as you normally would.

    Where are all of the settings (movement speed, impulse, rotation, InputX/Y) actually set?
    Speed, impulse, and rotation are specific to each motion. For example, the jump motion uses the impulse to push the player up... so it has an "impulse" property. The idle motion doesn't need an impulse property... so you won't find it as a property there.

    I talk about the "motion details" or properties on page 8 of the User's Guide. These would be specific to each motion.

    I talk about that a bit in this 'getting started' video.



    I've tried to create documentation and videos to help people create motions, but since I wrote the system I totally understand that my perspective is a bit different and I might miss something. I'm certainly happy to add/clarify/change things.

    I think checking out the videos and the Motion Builder's Guide may be a good start.
     
    Last edited: Jan 30, 2016
    BackwoodsGaming and FargleBargle like this.
  12. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,399
    I've put up a 3rd tutorial for creating your own motions.

    This one focuses on moving the character when there is no root-motion.

     
    BackwoodsGaming and FargleBargle like this.
  13. Recon03

    Recon03

    Joined:
    Aug 5, 2013
    Posts:
    839

    I bet that can happen, but keeping it so its for any framework, i'm sure is the goal? I would assume. But yes I bet it can be a pain . I want to thank you for a great tool so far, I just bought it a few weeks back, and already been loving it for my new Android game.. I plan to use it for my company's future new game as well for XB1. Normally we use our own solution, but it saves us hours and hours of work, and lets us flesh out and work on so many other aspects of the game..Also any time we needed to made some changes to code, or add new elements, it was super easy since your code is fairly easy to read and keep neat . Thanks for that.. Not to bash UFPS.. I bought it as a learning tool when it was first made for others, and that dev has made it into so much more, but I found that tool, to be a pain to customize anything..

    The AI looks interesting. I do not use that part since I have my own solution, I made a long time ago, and been updating since I enjoy AI so much..But for those that do not have one , it looks pretty good. So keep up the great work!
     
    Last edited: Jan 31, 2016
    Tryz likes this.
  14. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,399
    Thanks @Recon03 , your comments are super appreciated and the timing couldn't have been any better! :)
     
  15. Thickshake

    Thickshake

    Joined:
    Dec 31, 2014
    Posts:
    6
    Hi Tim. Amazing asset! I'm a 3d artist, Ive been using MC and AC in a project since mid last year and love it. Lots of developer friends who have seen my project have commented on how impressive it is and I tell them it's the character controller making everything seem so pro.

    I've upgraded to the new V2 of those assets and have got everything feeling the same as I had it, except I cant figure out how to get the graduation (blending?) of speed from walk to run cycle to work with the xbox 360 controller like the old version.. Like when you push forward on the left thumbstick at different amounts, the character would walk or run at different speeds. Is there some thing I need to do to get this working? Sorry if this question has been asked.

    One other thing, this might relate to the AC rig: When I push strictly up or down on the xbox 360 controller's right thumbstick, it doesn't move the camera pitch *until* I push slightly left or right on the control stick (as well as up or down). Was this an intentional change to prevent bumping the camera pitch around? Is there a way to change this?
     
  16. Dmuse

    Dmuse

    Joined:
    Jan 29, 2016
    Posts:
    4
    @Tryz

    Sorry if my post came across as frustration, I wasn't really frustrated, just lost. I was (am) still excited to get things working. I had watched (all of) the other videos and your code is well commented. However, the comments are more of a what things do rather than why, leaving your framework a bit of a mystery. :)

    Just wanted to thank you for the video, and in such sort order! I did clear up some things that I had been wondering and stands as a pretty good minimal steps to get your own code working in MC. I think it might have been helpful to include the call to the SetAnimatorMotionPhase just to help people set up for getting the animations in as well. Of course the other videos go over that well enough.
     
    Tryz likes this.
  17. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,399
    Hey @Thickshake , that's awesome... and thanks. :)

    For the first one, I don't do the graduation as it's more of a toggle.

    Let's take Walk Run Pivot as an example... if the "Default to Run" is unchecked and the "Action Alias" is "Run", the left-trigger will activate the run while it's held down (left-shift will too). So, it's more of an on/off thing.

    I think you're right that it is different than v1. But, with v1 I had a lot of questions (from keyboard users) on how to make him walk vs. run. So, I thought the toggle would be a better approach for everyone in general. But, it did loose that graduation with the Xbox controller. :(


    For the second question, I'm not seeing that. I loaded the latest MC, enabled the Xbox controller on the Input Source, and selected the "Adventure Style" (I'm using the "Orbit Camera"). As best I could, I just move the right stick up and down (not left or right at all) and the camera pitches as expected.

    Let's make sure "Is Xbox Enabled" is checked on the Input Source. I'm sure you did that, but just in case.

    Then, let me know what camera is enabled. Maybe our settings are slightly different.
     
  18. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,399
    Glad to hear that.

    One of the hardest things for me is figuring out what the right level of documentation is. As you can imagine, the Unity community has people of all different skill sets and backgrounds. Add in the fact that I probably take some things for granted and it can get a bit hairy...especially when you're talking about customizing an asset with code.

    I'm glad that last video helped and I'm happy to do more.
     
  19. florianbepunkt

    florianbepunkt

    Joined:
    Nov 28, 2015
    Posts:
    45
    At some point in the future (nothing urgent) I would be interested in seeing a video about using the MC noch with user input but driven by AI… either some basic script or one of the existing assets from the store (like behaviour designer or node canvas). I'm not looking for some specific integration but the general approach/workflow would be interesting. But maybe that's just me being nooooobish.
     
  20. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,399
    Hey @florianbepunkt , That sounds like a good one.

    When you say "with user input, but driven by AI". Do you mean clicking the ground and having the character move to that position? If not, can you give me a scenario and I'll see what I can do.

    Some things that might help in the mean time:

    1. Check out the "MC_NavMesh" demo in the ootii\MotionController\Demos\Scenes folder, if you haven't already. That shows a character using Unity's nav mesh agent to walk around objects to a target position.

    2. In the NPC Based motions on the Vault, I show how to have the character move between way-points.

    In both cases, the SetTargetPosition() function is the key. :)
     
    florianbepunkt likes this.
  21. florianbepunkt

    florianbepunkt

    Joined:
    Nov 28, 2015
    Posts:
    45
    Thanks. I'll have a look at these in the morning :)
     
  22. Dmuse

    Dmuse

    Joined:
    Jan 29, 2016
    Posts:
    4
    Hey Tryz,

    Situation: Body shapes are not working as I'd expect on other models. They appear to be created at runtime (At least I see little blue spheres in the scene which I am assuming are the body shapes) but they are not interacting as expected. Like the video in the quote above, my character can walk into the crates and then floats to the top.

    What does it take to get AC to create the body shapes (Body capsule/Foot sphere) or are these things that need to be set up on an actor manually? If so, what's the occasion for the 'Auto Create' button on the Body shapes area of the AC?

    The documentation let's us know what the body shapes are and how they are used by your system, but not how they are set up or what their properties need to be if we need to set them up manually.

    Thanks!
     
  23. Tryz

    Tryz

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

    What I think you're running into is the "smooth step" feature. Basically, instead of popping-up steps or boxes, I have the character rise up smoothly. This looked better than popping (in my opinion).

    You can do a couple of things:

    1. Disable it by setting "Step Up Speed" to 0.
    2. Increase the "Step Up Speed" to make the rise faster.
    3. Reduce the "Step Height" value.
    4. If you're dealing with ramps, reduce the "Max Angle" in the step section.

    Let me know if that helps.


    For the video and Body Shapes:
    The issue in the video ended up being that the character's root was at its center, not its feet. Once that was resolved, all was good.

    Body shapes are created in the editor (or through code) and are represented by the green sphere or capsule. I believe the blue spheres come from the Unity Animator.

    The "Auto Create" button just clears the existing shapes and adds the default setup that I describe in the documentation (body capsule and foot sphere). It's just a quick way to setup the shapes for a standard humanoid.

    I didn't document all the settings for a couple of reason:

    1. After doing this for 2 years, I've found that if the documentation gets too long... no one reads it. So, I tried to keep it short.

    2. I thought the settings and pop-up tool tips would be enough. Maybe a bad assumption on my part.

    For example:


    "Radius" is the radius of the sphere for this body sphere.

    "Enabled on ground" means this body shape would be enabled (or not) while you're on the ground.

    etc.

    How you use them depends on your character. For example, I know someone whose main character is a wolf and so he has a capsule on it's side. Someone else created a little fat monster. So, he uses one big sphere.

    I hope this doesn't come off as combative... I don't meant to be. If more documentation will help, I'll write more. You're just the first to ask. :)
     
    Last edited: Feb 2, 2016
  24. Dmuse

    Dmuse

    Joined:
    Jan 29, 2016
    Posts:
    4
    Hey @Tryz,

    Not combative at all. Hope you're not getting that tone from me either. I guess I'm just pointing out that I am reading the docs, but they aren't giving me the information that helping me when things don't go as I expect. Perhaps my expectations are too high. It really does look like you've tried to make everything streamlined and working well together. I think you have, at least when it comes to the assets you've set up and I'm sure with what you are used to working with. My guess is that there are assumptions you have that I'm just not aware of and am struggling through while getting the hang of the framework. Oh, and by the way, if something can break, it will for me. Please don't take any of my requests for clarification/help as criticism.

    As for the current issue. This appears to be one of those one-off things. After returning to setting up my scene the way I had it when testing, adding the MC component now created the body shapes as expected (they weren't being created at all previously).

    All of my settings are the same as those on Jones which is not causing the float up issue, but I'll have to play with the models I'm using a bit more and do some testing to figure out what is going on. My current thought is that that it's something with the models. For one of them, if I took away animations in the controller, the body shapes were targeted at chest level so something is certainly wrong.
     
    Tryz likes this.
  25. recon0303

    recon0303

    Joined:
    Apr 20, 2014
    Posts:
    1,634
    Jones1.png 172286[/ATTACH] what the..Must be a bug .. I was using VS, when I switched back to Mono, the set up showed up... So we can't use VS??? Odd bug or was this intended..I can't see this being an issue never seen this before with anything..But there is an issue that is for sure.. By the way this is Recon03.. My main account is messed up trying to resolve it through Unity, I can't use it right now.

    If I switch back to VS seems ok, but I need to switch back and forth. I did try this on a whole new project a few times, but it is an issue with VS, and the asset. I did this with no other asset installed either to make sure no other asset could be causing this.. I know Unity has been buggy so who knows if Unity itself is causing it, but I wanted you to be aware if there is a fix for it or even seen this happen before..If you see in the picture, all of your custom logos are even missing.. No set up ever shows up..I get no errors either. The motion controller is on it, and shows the same thing.. I added the Motion Controller in the Component as I always do. So this is a strange issue.


    Edit, I take that back, its acting wierd, not showing again no matter what I do now.. Not sure how to fix this issue, can't set up motion controller I will wait until I hear back from you. Thanks!
     
    Last edited: Feb 4, 2016
  26. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,314
    recon0303 and Tryz like this.
  27. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,399
    haha... I never knew you could do that.

    I removed my post that was before Damien's as it was useless.

    5 stars for Damien! :)
     
    Last edited: Feb 4, 2016
  28. recon0303

    recon0303

    Joined:
    Apr 20, 2014
    Posts:
    1,634
  29. florianbepunkt

    florianbepunkt

    Joined:
    Nov 28, 2015
    Posts:
    45
    I had a look into the demo scenes and the NPC vault motion as well as some general Navmesh stuff. What I would basically like to see is a video that bridges the gap between the Navmesh demo scene and the NPC vault scene. I will try to lay out my basic thoughts (more conceptional than technical) in order to describe my wonder-wishlist-demo-scene/video :-D

    I think the Navmesh demo scene has a very distinct approach that only fits specific use cases. It simulates user input (and is camera-dependent). I think a more generic use case would be that you play a character while another npc character does something (abstractly speaking). You can watch the NPC or not but most of the time you will play and have the player's perspective of your main character. Here the simulate input approach doesn't fit in very well (or I didn't figured out how… hehe).

    The NPC vault motion on the other hand has very flexible approach whch I like. You have a function that you can give one or several waypoints and the NPC will move. This is super modular and descriptie as you can call this method from your AI controller, or during cutsequences, or whatever you imagine and basically just say "NPC character should go to ponts A, B, C" and everything else is handled indepent of camera. The downside of this scene: It misses the pathfinding/navigation mesh features from the navmesh demo scene.

    What I would like to see is a demoscene or video that details a script/input how to feed an NPC motion controller a list of waypoints taht leverages pathfinding/navmesh. Ideally this does not stop with walking but includes more navigation mesh layers. Let's say to get from point A to B (or C) the NPC has to walk, but also use the Jump motion at a point and climb a wall/vault an obstacle at another point. If this whole motion controller power can be combined but at the same time keep the approach flexible and descriptive as in the NPC-vault scene (calling one method and just feed it a single waypoint or a buch of them) this would be awesome.

    I completely understand if the scope of this is way outside of a video. And maybe it's not that interesting for many people. Just wanted to lay out a scenario.
     
  30. Tryz

    Tryz

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

    It really is just a matter of mixing the code from the two samples and calling "ActivateMotion" for things like jump. But, I'll see about doing a video this week.

    It shouldn't be tough at all. I just need to finish up some things first. :)
     
    florianbepunkt likes this.
  31. florianbepunkt

    florianbepunkt

    Joined:
    Nov 28, 2015
    Posts:
    45
    Okay, cool. I'm not in a hurry. I guess the normal walking is managable for me, but the climbing up a wall/jumping part in order to follow a path I find a bit tricky :)
     
  32. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,399
    What I did in the past was test if the character couldn't get to his next waypoint. For example, if the waypoint is 5 units away, but the character isn't actually moving forward... after 2 seconds I'd shoot a ray forward to see if he was hitting a wall. If so, I forced a jump with "ActivateMotion". Either the character would jump over the obstacle or go into a climb if it could. That's how I did this:


    In other cases, I used waypoints to cause of the jump. Meaning if you're within 0.1 units, call "ActivateMotion".

    Hopefully that helps. But, I'll still do a video and try to lay all this out.
     
  33. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,399
    Another update of early combat in Hallow's Deep.

    As you can imagine, I'm using the Motion Controller for both the player and the goblin. One of the cool things about doing this is that I'm learning how I need to expand the MC. I'll be updating the MC with some of these changes soon.

     
    Last edited: Feb 11, 2016
  34. Bagnol

    Bagnol

    Joined:
    Sep 5, 2013
    Posts:
    169
    Looking good Tim. A common path when it comes to similar combat systems seems to be to have a recoil window of sorts, after an attack has been parried that leaves the attacker vulnerable and stunned briefly to create a distinction between an actively timed parry and a lazy block, is that sort of what you're going for? Or is it more about ensuring you're in a position to evade when the telegraph triggers and capitalize on them being locked into an attack animation?
     
  35. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,399
    Thanks. I like the counter-attack approach, but have it tied to skill progression. So, right now I have it were the defender just parries the attack. Eventually, that parry would create the stun that would open the door to a counter-attack. The parry window is actually a sliding window as well. Meaning I can change it so NPCs get harder or easier to fight.

    I also see evading being a big deal, but my Achilles heel is always animations.

    My big goal is to have it were the NPCs are capable of doing as much as you can.
     
    Bagnol likes this.
  36. Bagnol

    Bagnol

    Joined:
    Sep 5, 2013
    Posts:
    169
    That sounds really cool. Definitely sounds like each encounter is going to be different and engaging.
     
    Tryz likes this.
  37. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,399
    @florianbepunkt had asked about a tutorial showing how to use the MC with Unity's Nav Mesh Agent. So, I spent some time this morning and put it together:



    I didn't code everything that was asked, but this should give you the basic to put the pieces together as you need.

    Let me know if you have any questions.
     
    florianbepunkt likes this.
  38. florianbepunkt

    florianbepunkt

    Joined:
    Nov 28, 2015
    Posts:
    45
    Thank yo for doing this. For me it was quite helpful, especially the jump approach.

    I understand the reasons for your simulated input approach and I like how it looks in the demo scene. What confused me in the Navmesh demo scene is that it breaks if you don't have the follow camera rig on the character. If you for example add a static camera the scene and deactivate the follow rig on Jones he will either not move at all or fall of the cliff, sicne the Simulate Input function uses Camera position and angle. IMHO it might be better if the NPC is more like a self-contained unit that acts / moves independet of scene camera. Then I could use this Input Source for several NPCs for example without the need to give each NPC a follow camera rig.

    I hope it's understandable what I mean.
     
  39. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,399
    Totally. And you're right...it shouldn't.

    This weekend may be a bit crazy, but as soon as I get the chance I'll check it out. The camera shouldn't be required.
     
  40. florianbepunkt

    florianbepunkt

    Joined:
    Nov 28, 2015
    Posts:
    45
    Please, no hurry. It's the weekend, which sould be recreational time for asset developers as well. Also I'm more curious to see the next update on Hallow's Deep :-D
     
    Tryz likes this.
  41. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,399
    hahaha... thanks!

    I just put out a new version of MC. With it, you can now use the MC without having to assign an input source or camera (specifically for NPCs). So, the nav mesh demo will work even if you don't assign the camera... which is what it should have done from the beginning. :)

    Some other changes:
    Fixed auto-generate code to better support blend trees
    Fixed allocation issue in the AC
    Added IsEnabled property to AC and it updates position/rotation when IsEnabled is re-enabled
    Added support for setting the Animator at run-time
    Reduced Unity 5.3 warnings

    As always, please let me know if you find any issues.
     
    florianbepunkt and hopeful like this.
  42. AiryKai

    AiryKai

    Joined:
    Apr 16, 2014
    Posts:
    52
    Hi guys!

    Can I somehow call OnAnimatorIK in motion? Or something like that?
     
  43. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,399
    Hey AiryKai,

    Since the motions' Update() function is actually run in Unity's LateUpdate path, it's fine to put IK code there. This works because the LateUpdate path runs after animations are applied.

    In the past, I did tap into OnAnimatorIK. However, I removed it in v2 since it wasn't really needed. That said, if you find it is... I can shoot up an update that puts OnAnimatorIK back into each motion.

    (BTW... I'm using my IK solution and haven't dealt with Unity's IK solution in a while. If something has changed and I need to modify the MC to support it... I'm happy to. :D)
     
  44. AiryKai

    AiryKai

    Joined:
    Apr 16, 2014
    Posts:
    52
    I get this when trying to use in Update:

    "Setting and getting IK Goals, Lookat and BoneLocalRotation should only be done in OnAnimatorIK or OnStateIK"
     
  45. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,399
    Hi @AiryKai ,

    New version is up and it support OnAnimatorIK.

    Each motion can now override this:

    Code (CSharp):
    1.         /// <summary>
    2.         /// Callback for setting up animation IK(inverse kinematics).
    3.         /// </summary>
    4.         /// <param name="rAnimator">Mecanim animator whose IK we're processing</param>
    5.         /// <param name="rLayer">Index of the layer in the animator we're processing</param>
    6.         public virtual void OnAnimatorIK(Animator rAnimator, int rLayer)
    7.         {
    8.         }
    Just put the Unity IK code in there like you normally would and you should be fine.
     
    AiryKai likes this.
  46. AiryKai

    AiryKai

    Joined:
    Apr 16, 2014
    Posts:
    52
    @Tryz Thank you, Tim!
     
    Tryz likes this.
  47. borrowedLadder

    borrowedLadder

    Joined:
    Feb 11, 2015
    Posts:
    21
    Hey Cygnus,
    I've been trying to get this to work recently - it's working great for keyboard mapping, but I can't seem to get it to pick up the joystick buttons at all, I've had a look over the rewired documentation and seem to be doing everything right - did you find it easy to get that stuff to work?

    I know the joysticks are functional as they were working with the MC2 input source :/
     
  48. cygnusprojects

    cygnusprojects

    Joined:
    Mar 13, 2011
    Posts:
    766
    Hi @borrowedLadder,

    I couldn't provide the actual mappings to Tim because that requires the Rewired asset but give me 24hours time to see if I can provide screenschots on how I've mapped my controller. (need to find that test project back first ;-))

    Kind regards,

    Wim
     
    Tryz likes this.
  49. borrowedLadder

    borrowedLadder

    Joined:
    Feb 11, 2015
    Posts:
    21
    Awesome! Thanks for your help :)
     
  50. cygnusprojects

    cygnusprojects

    Joined:
    Mar 13, 2011
    Posts:
    766
    Hi @borrowedLadder,

    I created an exhausting document showing all steps to setup Rewired to use the Input source I created for Motion Controller. However I can't upload the document to this forum as the size is bigger than Unity allows. I mailed it to Tim (@Tryz) to put it in the Vault. If you PM me your email I can send you a copy as well.

    Kind regards,

    Wim
     
    hopeful likes this.