A Unity ID allows you to buy and/or subscribe to Unity products and services, shop in the Asset Store and participate
in the Unity community.
Discussion in 'Assets and Asset Store' started by Tryz, Feb 21, 2014.
will this be mecanim compatible?
Definitely. Mecanim works great for linking and blending animations.
You can see it in action with the web-demo:
To learn how it works with Mecanim, check out the Builder's Guide (rough draft):
It's available now on the store:
Let me know if you have any other questions.
I must say that this asset looks awesome and I will purchase it within a couple of days.
I have some questions:
1. I need to extend the controller to push objects around, pickup other obj etc... Would this be very hard to implement. I have my motions created which I got working with mecanim.
2. Would it be hard to extend your jumping logic into a double jump?
1. Since this controller extends Unity's Character Controller, I don't think there would be an issue:
I believe all you would do is tap into the OnCollision events of Unity's Character Controller, find the direction to the object you collided with, and apply a force (using Unity's standard approach) to that object. I haven't tried this, but it seems right.
You could do this inside of a motion script (if that made sense for your game) and that wouldn't be an issue at all.
Picking Up Objects
I think this has more to do with the Mecanim's rig than the controller. Meaning you'd parent the picked up object's transform to a bone transform in the rig. I don't think this is something Unity's Character Controller has hooks for directly and I didn't do anything to support or prevent it in the Motion Controller.
Quick side note, 'attachments' is something I'm starting to work on for my game as well. So I'm just now thinking about how I would handle this as a system.
2. No, it wouldn't be hard. This one I can answer with confidence.
Each motion has an UpdateMotion() function that helps manage the motion while it's active. In the Climb's UpdateMotion(), I wait for input to determine if I should climb-to-the-top or drop-down.
You could do something similar in Jump's UpdateMotion() and look for another input press. Then, you'd apply some additional impulse (making the character rise up again) and probably send the Animator back to the 'Rise' animation. The beauty of this is you can control when you'd allow the double-jump to take place.
Everything else would take care of itself.
Hope that helps,
EDIT: OK. Sometimes you have to restart Unity completely then it works
What’s happened? I just made a new project, updated motion controller as there was a new update for it in the asset store. Started just the demo scene and he doesn’t move. Ok copied over and replace
d the included input manager and still nothing. Now I don’t have the old working version.
Thanks for updating us! That's weird, but I'm glad it's working.
I just downloaded the Motion Controller myself and was testing. I didn't have a problem, but I know that's not a very satisfying response.
(The "There's a problem!" messages always put butterflies in my stomach...hahaha)
I've updated the Motion Builder's Guide.
I believe this contains all the content, but it still needs some grammatical love.
You'll find images of the overall architecture, walk-throughs of existing motions, and a detailed 'Build Your First Motion' section.
Obviously this makes sense to me since I built it.
Please let me know what you think and if you need clarification on anything.
Motion Builder's guide is looking fantastic, thank-you for all your hard work! Time to code some motions.
Agreed! Thanks for continuing to improve and build on this asset, it is absolutely awesome and super helpful. That being said, I couldn't figure out how to make motions myself, so I think I'll just let the expert continue to add them for me in updates.
I would also love to see a parachute motion, if you ever get a chance.
When is the Shimmy and IK update coming out?
URMOM, sorry to hear that. I know code can be a bit daunting.
If you haven't already, try the 'Build Your First Motion' tutorial. It should be step-by-step.
If you get stuck, email email@example.com and I'll help you through it. You may be running into an issue with the documentation that I need to fix.
In the end, it really comes down to these 4 steps:
1. Setup an animation (exactly like you do without the Motion Controller)
2. Setup the Animator (pretty much what you do without the Motion Controller)
3. Create a Motion Script. The tutorial one should take about 15 minutes (if you understand C#)
4. Add it to the scene and set the settings
Shimmy will be submitted to Unity by Friday night. For IK, I'm really not sure as I have to get back to my game for a bit.
Feel free to email me personally if you have issues with the code or documentation (specifics help). These will help me improve them for everyone.
Also, URMOM, real mature buddy, real mature...
To be honest, I'm not sure. If Unity supports coding across languages (like Microsoft .NET does with C# and VB), than we'll be fine.
Anyone have any experience with mixing Unity JS and C#?
Its possible to mix the languages but I try not to do it. There is a specific way it needs to be done though. If a c# script is accessing a Jscript, it needs to be in a directory that compiles first (such as Standard Assets, Plugins, etc.). It can only go one way and is a pain in the ass sometimes.
Hey Tryz, I think there is a problem with serialization of the layer motions when a Motion Controller is used on a prefab. If you make the character in your demo into a prefab and instantiate it at runtime, it will lose all its layer motions settings. I dont believe they are just lost visually because Im getting errors as well when they are lost. I instantiate my controller at runtime/spawntime so I need it to be a prefab. I will check your code too looking for the problem.
sorry for double post
I see now, how much c# I still have to learn.
I will try the updated doc and maybe something will click. What actually would be cool, is to create motion controllers visually without needing script, but this seems to be too complicated as I cannot find anything on the asset store.
quick question, I was messing around with a xbox 360 controller while using the asset, it doesn't seem to respond to how far you push the trigger. If I move it even a little bit, the character stops running. This wasn't the case with the Adventure Camera + Rig, is this intentional, or a bug?
Also, the mouse doesn't seem to move the adventure camera unless I hold down the left click. I did not change any settings, just imported it and this happened.
Last complaint, when turning around (holding S or down on the gamepad) it takes a few seconds for him to rotate and start running in the opposite direction, any way to quicken the speed?
Oh and there is still some clipping:
There are lots of other bugs, nothing that major though. Can't wait to see it improve!
The Adventure Camera seems to have some bugs with the Motion Controller, I have the motion controller working on my avatar using the FollowRig.cs script with no issues, but when I try to import the AdventureRig.cs into the Framework_v1/Cameras folder (I have deleted all the other AdventureCameraAssets) and then drag the script to the CameraRig in the Inspector, Unity keeps giving the message "Can't add script behaviour AdventureRig. You need to fix all compile errors in all scripts first!" The console keeps giving these 3 errors:
Assets/ootiiMotionController/Scripts/ootii/Framework_v1/Cameras/AdventureRig.cs(377,43): error CS1061: Type `Controller' does not contain a definition for `CameraRigAnchor' and no extension method `CameraRigAnchor' of type `Controller' could be found (are you missing a using directive or an assembly reference?)
Assets/ootiiMotionController/Scripts/ootii/Framework_v1/Cameras/AdventureRig.cs(387,29): error CS1061: Type `Controller' does not contain a definition for `FaceCameraForward' and no extension method `FaceCameraForward' of type `Controller' could be found (are you missing a using directive or an assembly reference?)
Assets/ootiiMotionController/Scripts/ootii/Framework_v1/Cameras/AdventureRig.cs(650,45): error CS1061: Type `Controller' does not contain a definition for `ColliderRadius' and no extension method `ColliderRadius' of type `Controller' could be found (are you missing a using directive or an assembly reference?)
Also I noticed from the documentation that the AdventureRig Inspector Settings requires a Controller instead of an Anchor like the FollowRig, does this also require dragging the DefaultAvatar since there is no AdventureController in the MotionController Package?
I just got home and replied to your email. If you can confirm what I put in the email is true, that would help.
Also, when you reply to the email, will you confirm that you followed the steps in this document (page 27):
I think some files got overwritten or maybe even removed accidentally. We'll get it worked out.
Thanks for the info on the prefab. I might know what's going on. I'll test tonight and see if what I'm thinking is happening... is.
For the trigger push:
When you're using the Motion Controller + the Adventure Camera, the trigger is working the same as the Adventure Camera project alone. Any activity on the left trigger will force you into the 'over-the-shoulder' walk mode. I just ran them both and confirmed.
When you're using the Motion Controller + the Follow Camera, the trigger will force you into the walk. However, since the Follow Camera doesn't have an 'over-the-shoulder' mode, it stays behind the avatar.
In both cases, I treat the trigger like a button (on/off) and not like the analog stick it really is. I hope that helps.
I think what you're saying is that the avatar isn't rotating when you hold the right-mouse-button and move the mouse unless you're also moving the avatar (with the left stick or W/S keys). This was by design, but I'll admit that I may not like the design anymore.
It's something I'll look into. I do have the idle-rotate animations in. I'm just only activating them unless there is speed too and probably wasn't the best idea.
Reverse when idle - speed:
Unfortunately, it's part of the animation. I'm using the raw Unity animations and this is how the animation was built. I did try speeding it up with the blend, but then the character doesn't pivot a full 180. Other than replacing the animations totally, I haven't found a better solution.
If you do have a different set of animations, using them should just be a matter of replacing the existing ones that are in the Animator. I could point you in the right direct if you need. Just shoot me an email.
Hmmm... There should be limits that prevent that. You're using the AdventureRig.cs for your camera, right? Is there a wall (with a collision box on it) in front of the avatar?
I'll look into it.
I just want to say this kind of detail is great. When someone says, "There's a ton of bug" and vanishes, I don't know what to do with that. Here, I've got some things I can explain why they aren't bugs or fix them if they are... Thanks for your patience!
More than likely their "tons of bugs" are their own screw ups Thanks man I cant find the problem either. I checked the editor scripts over and they look fine as far as serialization. Ill wait for you to look into it.
Thanks for the quick response, I actually managed to get it working by creating a new project with just the ootiiMotionController and the AdventureRig.cs, it seems the "SpaceNavigator driver v1.1.2" is interfering with the script and causing the problems. Is there any way to fix this so I can continue using a 3D SpaceNavigator Mouse?
So I downloaded the SpaceNavigator and I see they have a class called "Controller" as well. What I believe is happening is that our "Controller.cs" files are conflicting with each other.
This is one of the reasons I use namespaces. With namespaces, you can tell the difference between the two. Think of it like two people named "Tim" and someone yelling out "Hey, Tim". It gets confusing.
With a namespace, it's like someone yelling out "Hey, Tim Tryzbiak". We can be specific should a conflict occur.
Unfortunately, they didn't use namespaces and it looks like Unity is referencing their "Controller.cs" first. I don't know of a good solution other than to ask them to use namespaces. I'll dig into this a little more, but I think that's going to be the answer.
I didn't change anything from the imported version besides adding my own environment, so I'm not really sure..
I'm not sure what you mean by the trigger thing, I know clicking left trigger puts you into a walk, I mean when you push the analog stick forward 30%, it goes at the same speed then if you push the stick 100%. I was just wondering if this is intentional or just something I'm doing wrong,
I actually just bought some mo-cap tools, I won't get them for a few months (as it is a kickstarter), but to test it out i'll make a ton of animations for you that could help polish old motions and make new ones.
Well, not so much bugs, more just it being unpolished, (i.e. the character will move oddly and sometimes play the fall animation while on the ground,) but it is still my favorite asset out there. Thanks for all the awesome support though! I mean it when I say this is by far what I care most about from the Asset Store, and it has the most potential to become a fantastic product.
3, I hit script class conflicts often and usually have to refactor whichever script you prefer. If you know about refactoring, you can rename one of the Controller.cs files to something else. Like for space navigator name it "SNController.cs" and rename the class inside of it to the same thing.
so in Controller.cs find "class Controller" and change it to "class SNController"
You may get some errors and need to change Controller to SNController in some other scripts too but it should be rather straight forward and just take some text editing.
@Tim - Shouldn't you be using CreateInstance for instantiating ScriptableObjects instead of using new? I get several warnings in the Editor in 4.3.4. That may be due to the object not having init values though (due to the serialization problem).
Your details are great.
For the walk, yes. there is no speed difference between 30% forward or 100%. The reason is that if I blended between idle and walk, it look really odd. He did a jerky kind of pop. So the walk is just a full walk if there's movement forward.
Yes. That's exactly the thing I'm looking at when I mentioned I might know what's going on. Not sure why I didn't get the warnings earlier, but I may have had them off (which I normally don't do).
I'm continuing to look at it now and will shoot you a heads up when I have something.
Thanks both of you!!
Wondering how you have built this. Are you using systems similar to the regular character controller that only works on flat terrain. Because looking for character controller that can use different types of gravity, think planet. Or does this only support planes?
Check out the web-demo:
You'll see to the right is an area of pretty frantic terrain...definitely not flat!
The Motion Controller uses it's own gravity setting so you can decrease/increase as needed. This would allow you to do things like levitate or create a "moon jump".
It is based off of Unity's built-in Character Controller. That means the collider capsule won't rotate. So trying to do something where the character walks on walls probably won't work as expected.
Hope that helps,
Firstly, Tim, I'm not stalking your thread, promise.
@Frantico, check out Faux Gravity (video demo of it doing exactly what you ask, here - http://www.youtube.com/watch?v=gHeQ8Hr92P4)
thanks you blockcipher exactly what I was looking for, don't you love the unity community always so helpful
Tested the demo tryz impressive Seems like a good ground to build from, your asset
hahah... NP blockcipher... stalk away.
I see what he was asking now (thanks to the video). I miss understood the 'think planet' sentence. Glad you where here.
I think we all are stalking this thread more or less, just a matter of how much we comment,
So I was just wondering, the Shimmy will be released by the end of this week, and then you will take a break from it and continue adding new motions in a few weeks or so?
Also, a cool idea, rather then you having to create motions for everyone, what if everyone could just share the motions they have made on this thread as a unity package, or put it as an extension for the Motion Controller on the asset store?
The shimmy may be on hold this week.
An issue with the Motion Controller being used in a prefab was brought up and given some limitations with how Unity stores and reloads data, I'm having to do a fairly large work-around to support prefabs. I'll know more about how large tomorrow as I'm trying some different things now.
You're right on with the other points.
My goal has always been to release motions here and there, but this can't be my full-time job (I don't get paid enough for that ). The hope was that people would follow the Motion Builder's Guide, build, and share. There are some limitations with the sharing that I have to work through (for example: How do you merge Animators since each character can have only one? Also, how does someone put something up on the asset store that doesn't actually run by itself?). These are things to work through, but you're right on with the my goal.
In reference to the sharing of motions, if there was a way to have the different motion controller layers reference different state machines and compile one for the character being driven that would be ideal...
see here for ideas? I know this would involve a lot of re-writing of things however.
The asset store will let people sell animations separately, so people would have to sell them as Ootii compatible animation packs, or, if the pack contained no animations (which would be less than helpful, because so many motions are animation dependent) one could post it as a script pack. Ultimately people are probably going to have to know enough about how the system works to at least copy and paste inside the animation state machine and setup transitions from 'any state'.
@Tryz Did a check on the profiler on the package for your demo scene. While not awful, the GC spikes on motionController Update() are some what of a concern. It makes me worry that if I add anything else to the game there is a large possibility of jumpy frame rate. Since the motion Controller is one of the only constants in the game, it hampers the overall performance. Do you have any plans of optimizing that, or is that as good as it can get given the controllers features?
I think that would be the best way to go about it, I couldn't figure out how to build my own motions, who here knows how to make motions and would put them up on the asset store?
Damn it, I really wanted that Shimmy though, too bad, when will it be out then?
@ DL_Studios : I saw this too, but running the profiler on the other character controller that I have was noticeably worse. I think that ones' character controller might just be a performance hog, I couldn't figure out how to fix it (though my knowledge is not in this area at all) because that update needs to run. You could make it run every other frame or something I guess.
@3 - I have something in the works for my game, it might take a while to put together, but it'll be an overhaul and massive expansion of the motions in the motion controller with new mocap animations. If there's any interest I may put it up for sale, it's quite expensive and time-consuming to put together this kind of stuff with custom motion capture, particularly for interesting motions like swimming, parkour, diving and climbing that are hard to capture on most mocap stages. We have access to one that has been setup with a rock climbing wall and parkour props, so I'm diving into that. Then it's a matter of coding it. But it should be quite cool when finished. I'm going to make it as fully featured a drag and drop system as I can, and so I'll be asking for the community's advice as I go along to try to make it as appealing as possible. The cool thing is it'll work as a mocap package and as a nice addition to what Ootii has done here. This package is quite impressive in my mind.
I'll have to mull it over a bit. I don't think having them on different layers helps since there's only one Animator.asset on a character at a time. The link you sent was interesting though.
I do have optimizations to do. My profiler tests were showing an average time of about 0.1 milliseconds, but I knew there were some spikes. Like you said, it wasn't awful, but it can be better.
The good news is that outside of the prefab issue and requests for new motions/animations, most things were calming down and I was starting to do more performance tests on my own. (That's why the profiler class was in the solution). I should be back to that by the end of the week.
I think I've got a good solution for the prefab stuff. Now I'm implementing it. If it goes well, I still may be on track for a shimmy push to Unity on Friday.
Just trying to be honest about what I can get to.
negativecap = awesome!
Yeah, I just saw on the last page of that link that it looks like he's generating the animator at runtime via script. Kinda the only way to make addons possible in a modular way, but would require a rethink of not just this product but mecanim itself!
If I may ask, what kinda motions do you have in store? If it has some stuff that I would need, I know for certain I would buy it. It may help you recoup some expenses from the mo-cap sessions and whatever else there is.
The proposed control scheme is a rather long doc, so I won't copy and paste it here, here's a link.
The basic states will include:
Scramble (automatic on 45-85 degree terrain)
Balance - (auto via tags)
Swim - (auto via tags, possibly with proceedural dive)
Parkour Movement - (auto via tags)
Climb (Wall) - (automatic on 85+ degree terrain)
Climb (Ledge, feet hanging) - (auto on ledges via tags)
Climb (Ledge, Feet on Wall) - (auto on objects via tags)
Climb Overhand - (monkeybars style, auto via tags)
Climb Rope (Horizontal/Vertical) - (auto via tags)
Climb Ladder - (auto via tags)
Cover Walk - (auto via tags)
Cover Crouch - (auto via tags)
Combat - (State for each weapon, plus hand to hand, masked layer)
Aim - (State for each weapon, plus hand to hand, masked layer)
Fire 1/2 - (State for each weapon, plus hand to hand, masked layer)
Let me know if the link doesn't work, and if you don't see something you want.
This is literally, everything I was hoping for, maybe a zipline for added effect, but I couldn't ask for anything else.
If you don't end up selling this on the asset store, could you contact me personally (via a PM or something) and I'll buy them at whatever price you want (within reason),
when will you end up completing this?
@3 that's the big question, like I said, a few more days in the mocap studio, cleanup, some custom animation work probably and then coding. Lucky for me (I guess) most of the development of my game is on a bit of a hold until a 64bit version of the unity editor comes out and I'm not Tryz, so I don't have to spend all my time on the controller itself, I just reap the benefits of a sweet little system
I'm hoping to have at least the locomotion states done by early summer, possibly sooner, I'm going to hire out some of the work, possibly more if it looks like folks are interested just to get it there sooner. I don't really need to make a boatload of cash on it, but it's an expensive process so it won't be a $30 asset.
Oh, and we'll have a zipline (rope/at horizontal angle/slide down animation anyway) if that's not what you mean post a video and I'll try to emulate it.
Sorry Tryz for the threadjacking, I'll stop now.
Threadjack away! This is awesome.
About 50% of my time has been doing animations. I'm a programmer so that goes really slow for me.
That's awesome that you've go some animations covered.
Quick side note:
I've got an internal build of the prefabs working. I still have some more testing to do, but so far it's working as it should.
exactly what I meant, this in conjugation with the Motion Controller will produce awesome results, If there is any way I can lend a hand let me know. And again, if you end up not putting it up on the asset store, I'll buy it personally.
Seriously though, let me know when it's done or if you need something to make it even better, I'm here as a free resource to anyone who needs any help regarding the motion controller.
Look like I have a new asset to get excited over,
Awesome man. Appreciate the time you are putting into the prefab problems. I have been using a temp workaround for now (instantiating a controller with a disabled script and having another script enable and initialize it). Works for now anyway.
@everyone else, Are you guys talking about regular mecanim animations or the coded motions that would work within the motion controller? There are hordes of good animations out there.
For parkour especially - https://www.assetstore.unity3d.com/#/content/15704
And there are the animset motions too. https://www.assetstore.unity3d.com/#/content/14148
All they would need is the scripts to make them work with the MC, or substituted in the Humanoid controller.
Negitivecap is the first to be making an add on for the main asset. Basically, he is going to get animations (swimming, etc etc) and code them to work specifically for the motion controller, then possibly put it on the asset store.
Ahh ok. I think someone should. I might take some interest in doing that also. That will leave Tim time to add/fix features instead of screwing with animations ;P
I've finished the prefab work and my testing. I've also asked a couple of people to help test, just for some extra eyes on it.
For you techie types, here's what the issue was:
Unity stores prefabs outside of the scene itself. That's not much of a surprise, but they store them differently than they do the scene. Basically derived class instances stored in a generic list aren't stored correctly by the prefabs. After some research, it turns out this has been an issue for a while.
If you want to know more, the maker of PlayMaker talks about it some here:
I've worked around this by storing a JSON motion definition instead of the actual motion itself.
The good news...
After the next update, the Motion Controller will support prefabs like it should.
The bad news...
I don't take this lightly and I'm super sorry for putting this onto you, but you will have to re-assign the motions to your characters. Once you do the update, you'll see your Layers in the Motion Controller, but it won't show any Layer Motions. They will have to be re-selected and properties re-set.
This shouldn't take you more than 5 minutes, but you may want to capture your settings first. Like I said, I don't take this lightly...it just sucks.
I spent the better part of today trying to find a way to extract the old motions from Unity's serialized data, but no luck. Since I'm storing them a different way now, it will be like you never assigned motions to the motion layers.
Obviously the sample scenes will have them, but your custom scenes won't. Going forward, you won't have any issues. I don't expect it to happen again.
Because supporting prefabs is such a big deal, I'm planning on pushing the update tomorrow morning (assuming testing continues to go well). With a little luck, it will be live on Friday. At that point, I'll start working on the shimmy again.
If you do have a major issue or concern, please feel free to email me at firstname.lastname@example.org.
Thanks for understanding!