Search Unity

Motion Controller

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

  1. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,382
    haha... Unity finally released the update today.

    You can get v4 from Unity or I'll keep the v5 offer available (see above) to those that want it.

    I'll give v4 a couple of days and then submit v5 to Unity. Just expect it to take another week before it's released.

    Thanks again,
    Tim
     
  2. sleepingwalrus

    sleepingwalrus

    Joined:
    Jan 6, 2013
    Posts:
    9
    Thanks getting a fix in so quickly, and for making it available ASAP for those who need it. Unfortunately I'm swamped with non-gamedev work right now so I don't have time to play with this or with mount points. Looking forward to it though.
     
  3. blockcipher

    blockcipher

    Joined:
    Jul 4, 2013
    Posts:
    19
    MountPoints is awesome and implemented into my pipeline very simply. Works great on prefabs also! I sent you an email Tim.

    You should put that asset on the store man. Ill give it a good review. Ill also take some screens/videos of the system in action if ya like. As soon as I get it tied tight with my GUI.
     
    Last edited: Apr 1, 2014
  4. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,382
  5. TheValar

    TheValar

    Joined:
    Nov 12, 2012
    Posts:
    760
    I've been looking at this asset and I have a couple questions about it, mostly related to configurability and expandability.

    1) Am I correct in thinking that this uses Unity's default character controller at the core? I ask because I'm worried this will cause issues since the character controller can't be rotated. For example if I wanted to make a motion that rotated the character to match the surface he was standing on could I do that?

    2) Could the motions for this controller be configured to have a more "binary" feel to them? By this I mean less realistic and more along the lines of what you would see in something like Mario 64.

    Just to give you some background I'm looking for a good starting point to make a 3d platformer and although there is the popular 3d physics based platformer kit on the asset store I feel that this could potentially be a much better base system.

    Thanks and regardless if I end up purchasing this, congrats on an awesome asset :D
     
  6. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,382
    Hey Valar, thanks for the kind words.


    1. It is based on Unity's default character controller.

    You're exactly right about not being able to rotate the collision capsule. This was the single biggest draw-back I saw when deciding to use the default character controller, a rigid body, or completely rolling my own. I decided to go with the default because it had already disabled the physics engine (a plus for most character controllers), but it still had things like sliding against walls, stepping up, and good collision support.

    In our game, I plan on having spiders that climb the walls. While the collision capsule won't rotate, you can rotate the model inside of it. This won't work for all characters, but it will for spherical shapes or if you add collision shapes that augment the built in capsule.

    The system supports disabling gravity per character so that will help with climbing walls. I haven't actually don it yet so I'm sure there will be a surprise or two.


    2. Definitely.

    In the end, the Motion Controller is managing the animations that you use. If your animations are more blocky or robotic (that's what I think you mean by 'binary'), that's fine. If you are planning on redoing all the animations, you may have some work to do in the motions themselves. Take the jump for example, I use about 7 different animations so that the jump is physics based and looks good no matter how high you jump. You could change it to a much simpler jump, but you'd probably want to create a new motion. Not a hard thing to do, but something to be aware of.


    Hope that helps,
    Tim
     
  7. TheValar

    TheValar

    Joined:
    Nov 12, 2012
    Posts:
    760
    Thanks for the quick feedback!

    It's too bad about the rotation I doubt I'll end up having any requirements that can't be satisfied with rotating just the model. I think you have a buyer :D
     
  8. TheValar

    TheValar

    Joined:
    Nov 12, 2012
    Posts:
    760
    BTW when do we get to see your game in action?
     
  9. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,382
    Welcome to the club! haha...

    If you have questions or run into any issues, please don't hesitate to email me: tim@ootii.com.

    We're just starting development/prototyping of our game. It will be a while yet. As we get a little further along, I'll share some links. :)
     
  10. imaginationrabbit

    imaginationrabbit

    Joined:
    Sep 23, 2013
    Posts:
    331
    Brand new user- working through the docs-

    I tried replacing the punch animation on the "fighting" layer with my own punch animation- it worked but all the spinal rotation was ignored- any tips?

    Also I want the character to walk by default- I tried adjusting the blend tree but couldn't get it working-any tips if I want my character to walk by default and only run with Shift or a joystick button is pressed?

    Should I be asking these questions here or should I email you at your support email?

    Thanks!
     
  11. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,382
    Hey M,

    Welcome!


    The fighting layer uses Mecanim's standard mask to limit where animations are active. You can find that mask in the ootiiMotionController/Models/Animations folder and it's called "Upper". One of the things I learned is that Unity's humanoid mask system is pretty limited. Apparently the spine is not considered part of the chest area.

    So, there are a couple of options:

    1. Use a different humanoid mask for the layer. It's just a simple replace, but your animation would need to be built to match the mask you create.

    2. Build your animation to not relay on the spine movement. That sucks, but it's what I had to do with the punch.

    3. Use a full animation for combat and put it on the first layer.

    To be honest, I'm not happy with any of these solutions. However, short of building my own bone system or using something like FinalIK, we're stuck with what Unity gave us.

    For my combat system, I think I'm going to go with fully body movement and not rely on layers.


    For the walk default, I've gotten that request a couple of times and this morning I've created a simple tutorial for you (and others). Consider it a "Learn to Build Motions" tutorial ;).

    You can find it here:
    http://www.ootii.com/unity/motioncontroller/MCMotionBuilder_DefaultWalk.pdf

    In it, I give you all the code to build your first motion and take you through what I think about when building motion. I hope it helps.
     
  12. TheValar

    TheValar

    Joined:
    Nov 12, 2012
    Posts:
    760
    I was playing with the webplayer demo yesterday linked to from the store page and noticed what seem to be a couple bugs

    1) with the normal follow cam scene I couldn't walk backward/turnaround. If a pressed the s key the character actually walked forward. I'm not positive what the expected behavior here is but I assume he is supposed to either walk backward or turn to face the camera?

    2) in many cases when I grabbed a ledge, no movement was possible afterward. By this I mean I couldn't shimmy, climb up, or drop down. I was forced to reset the scene. I'm not sure the best way to replicate this occurrence but it seemed to happen when I grabbed a ledge from a jump. If you can't replicate the issue I will try to dig into it more.
     
  13. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,382
    Hey Valar,


    1. With the basic camera that's part of the Motion Controller, it always stays behind the character. So the character will never be able to turn towards the camera (without some code changes).

    The SimpleForward motion doesn't implement a backwards walk/run either. There are some motions that do have that feature, but this wasn't one.

    The reason goes back to the camera. If you're using a gamepad and pushing towards the right, he runs and rotates towards the right. The camera then moves to the behind position. If at some point, you move the stick from the right position to the down position it felt weird to have him come to an abrupt stop and go backwards. It just didn't flow well.

    I agree that pressing the 'S' and having him move forward isn't very intuitive. I'll fix that in the next release or two.


    2. I haven't experienced this before. I just tested and everything seems to be fine for me.
    http://www.ootii.com/Unity/MotionController/Web.html

    One thing you might be seeing is that the character won't shimmy if there isn't enough room for him to settle into a good spot. There's no fractional movement. So when a shimmy is attempted, if the predicted location isn't a good stop, he won't shimmy. That's a parameter on the motion that can be set in the scene to determine how far that prediction goes out.

    That doesn't explain him not releasing or climbing up, but I'm not able to duplicate that.


    Any extra info you can give me would be appreciated. Feel free to email me at tim@ootii.com directly.
     
    Last edited: Apr 3, 2014
  14. TheValar

    TheValar

    Joined:
    Nov 12, 2012
    Posts:
    760
    1. Ok thanks for explaining that, it makes sense to me.

    2. I'll see if I can get a video of it happening, as well as narrow down what causes it.
     
  15. imaginationrabbit

    imaginationrabbit

    Joined:
    Sep 23, 2013
    Posts:
    331
    Thanks for the answers and for the motion builders guide- reading it now

    Works perfectly-awesome! Thanks Tim!
     
    Last edited: Apr 3, 2014
  16. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,382
    No problem M! Glad it worked.


    Valar, I've been playing with it off and on for a couple of hours and it's never prevented a climb-up or release. Any info you can send about your OS, other packages you may be using, etc. would help me. I don't want to just ignore a potential issue. :(
     
  17. negativecap

    negativecap

    Joined:
    Jan 27, 2013
    Posts:
    99
    @TheValar

    I was having this problem occasionally b/c I forgot to set-up the 'climbable' layer (layer 9) in a new project. Just a thought.
     
  18. PlayingKarrde

    PlayingKarrde

    Joined:
    Aug 19, 2013
    Posts:
    35
    I've spent a little time with the controller now and it is definitely a very good starting point. I'll be delving into it deeper in the coming days and weeks but there are a few things that are a bit wonky and would be great if you could look at?

    - First off, the jump when having input turned off (since to me that makes more sense than giving the character full control in the air) is pretty buggy. If you hold forward and jump and continue to hold forward the momentum is correct and everything happens as expected. However, if you hold forward to jump, then release forward when in the air he doesn't continue his momentum (making the use input kind of pointless). The next jump that occurs is also rather odd. Not really sure how to explain it so maybe try it on your own and see? The same inconsistent behaviour applies when doing a standing jump and then holding forward mid-air.

    - When holding a ledge and pressing up you shimmy sideways. Is this intentional? I would expect to be able to either push up to have him pull himself up or up+A pulls up (right now you have to completely release all joystick inputs for pull up to occur)

    - The turning on the spot is extremely clunky. I realise this may actually be an animation thing, but the fact that the entire turn on spot animation has to play before he will move in the new direction makes the character feel like a tank when not in motion. Again, I'm assuming this could easily be solved with an animation that goes from turn on spot into walk/run.

    - This is probably more of an Adventure Camera thing but since I'm here I've also noticed that if your character is close to a wall, when rotating the camera around him, it will correctly move itself so it doesn't clip, but if the character's head is too close the camera just stops dead. Continuing to hold the direction will eventually snap the camera out of it and will jump to the location it would have been had it not gotten stuck.

    - Any chance the motion layers section could remember whether it is revealed or not in the editor? It's pretty annoying having to reveal it each time I select something else in Unity then come back to it.

    Anyway, I'll continue to work with this as it's a pretty great start to be sure and I'm looking forward to adding my own motions. I think fixing those few things I mentioned will go a huge way to making it feel a lot more polished though.

    Good job so far though and thanks again!
     
  19. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,382
    Thanks Negativecap. It's cool that people are helping each other. :)

    Thanks PlayingKarrde. This is all good stuff

    This was a bug that someone just sent me the other day and it will be fixed in the next update.

    It was on purpose, but I see what you're saying. Since 'Jump' pulled him up, I let any movement on the x-axis shimmy him. In playing Tomb Raider again, it behaves closer to what you said. I think what I need to do is disconnect the input and create input actions like 'MoveLeft', 'MoveRight', 'MoveUp'. Then users can determine their own input controls.

    Agreed. As a default, I'll probably disable the animations in the animator.

    This was by design. If your character is too close to a wall and the camera detects it, it will move in. At some point, my only option is to clip into the character, clip into the wall, or stop moving the camera. I chose the later. However, when you get to a clean spot, it 'catches up'. Unfortunately, I don't want to clip and the best idea I had was just to pop it in place.

    Unfortunately, no... at least not that I've found. Since Unity recreates the sub-sections on clicking an object, everything starts fresh. I figured it was better to have the default closed in order to take up as little room as possible.

    Thanks. :)
     
    Last edited: Apr 4, 2014
  20. PlayingKarrde

    PlayingKarrde

    Joined:
    Aug 19, 2013
    Posts:
    35
    Thanks for the response. Regarding the camera issue (should be careful not to thread jack here...) when I did this for my camera system I faded the character to a certain amount when the clipping was about to occur. This seemed more elegant and less intrusive to me. Perhaps something to consider?

    I'm sure I'll be back with more feedback soon. I'll be digging into creating my own motions very shortly. Pretty excited to see what I can do with this! :)
     
  21. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,353
    very cool package.

    I'm wondering how to integrate this with FinalIK and AnimFollow. Can you explain how you see the system could be used with the other two packages. In terms of use cases.

    Cheers.
     
  22. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,382
    Thanks PlayingKarrde.

    Using deferred rendering with limited alpha support is what kept me from using that approach originally. It may just be a matter of mixing deferred and forward rendering, but I haven't looked into it yet.


    Hi Rocki,

    I don't own either FinalIK or AnimFollow, so my comments are a bit generic. FinalIK I've heard of and get, but AnimFollow I just looked up and don't really understand yet.

    In the end, the Motion Control is a character controller with built in support for managing and adding animations. I call the mixing of animation and code 'motions'. I haven't seen another character controller that helps you determine when it's time to start an animation, time to stop, or that helps manage the life-time of the motions in a generic way. Our game is a 3rd person action-adventure and I wanted to be able to add new animations and capabilities as we go forward. This includes motions I haven't even thought of yet.

    In my limited understanding of FinalIK, it allows you control the skeleton on the fly through IK. To me, this is almost like being able to create animations that dynamically react to the world. I think this would work well with the Motion Controller as you can put the IK logic into motions themselves. When the Motion Controller determines it's time to run something like the jump motion (based on conditions you setup in code), the jump motion activates and runs on each update. What you code into that motion is totally up to you. In the current jump, I have a physics force that pushes the character up and then manages about 7 different animations. In the jump's update, no reason you couldn't manage IK also.

    Imagine what happens when the player makes contact with the ground and lands. Right now, I play one of the animations. However, you could use IK to adapt to the terrain better. In fact, that's something I've played with using IK in Unity Pro.

    Each motion is simply a separate entity that has a life cycle. You can code whatever you want within that life.

    Hope that helps,
    Tim
     
    Last edited: Apr 6, 2014
  23. Donotdistherb

    Donotdistherb

    Joined:
    Dec 17, 2013
    Posts:
    2
    Hello,

    I updated the last version available on the asset store and now I have this error:

    Assets/ootiiMotionController/Scripts/ootii/Framework_v1/Physics/Force.cs(77,44): error CS1061: Type `com.ootii.Collections.ObjectPool<com.ootii.Physics.Force>' does not contain a definition for `Length' and no extension method `Length' of type `com.ootii.Collections.ObjectPool<com.ootii.Physics.Force>' could be found (are you missing a using directive or an assembly reference?)

    What am I missing ?

    thanks
     
  24. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,382
    Hey D,

    Are you using the Adventure Camera Rig as well (or have one of my other packages)? My initial guess is that the wrong ObjectPool is being used.

    Feel free to email me directly at tim@ootii.com and we can get this worked out.

    When you do email me, will you attach the ObjectPool.cs file found in the Scripts\Collections folder? I'm just curious what yours looks like.
     
    Last edited: Apr 8, 2014
  25. Donotdistherb

    Donotdistherb

    Joined:
    Dec 17, 2013
    Posts:
    2
    Indeed I'm using it too.

    thanks for the quick answer!

    Edit: Ok I found the problem, something went wrong when importing the package. I reimported it and it's working now.

    Thanks.
     
    Last edited: Apr 8, 2014
  26. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,382
    Cool.

    Remember, when using the Adventure Camera Motion Controller, you only need the AdventureRig.cs from the Adventure Camera package. You should delete everything else or you could get conflicts.

    Unfortunately, I haven't found a good way to share files across multiple packages. That's why the Motion Controller started using the 'Framework_V1' folder. I plan on putting that into the Adventure Camera Rig package (and all other packages) as well. Then you can just ensure you only ever have one 'Framework_V1' folder alive at one time.
     
  27. blockcipher

    blockcipher

    Joined:
    Jul 4, 2013
    Posts:
    19
    Awesome update man ... Im working on integrating FinalIK into MC and its not very difficult. FIK just exposes an IK rig and editor controls that let you manipulate a rig like a puppet; so it's basically just replacing generic IK calls with FIK ones. FIK is a really really awesome system. Used with the Mecanim Foot placement package it's an awesome combo. MC helps tie it all together really nicely!
     
  28. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,382
    Hey Blockcipher, that's really cool. I've had a couple people ask about FinalIK, but I don't own it yet and could only speculate. What you said is pretty much what I expected (and hoped). I plan on messing with it soon, but just haven't had the time.

    Now, for everyone except Blockcipher, there's a new release out. :)

    I've been doing some work to ensure Motion Controller will work with characters of different sizes. The climb is really what I found some issues with and cleaned up. You can see it in action with our goblin:



    We've still got a bunch of work to do with shading the goblin and adding his specific animations, but you can see he's half the size of the demo-man and things are working well. It does take some tweaking though and I've already found a couple new things I need to push in the next update.
     
    Last edited: Apr 9, 2014
  29. kurotatsu

    kurotatsu

    Joined:
    May 10, 2012
    Posts:
    588
    I love this system, and adventure camera.

    I moved my entire game to Unity 4 because of this, and just because this system played so well on the web demo with an ouya controller(minus toggling the stealth, which now you added this new tutorial pdf, i think i can add the right key myself).

    The only issue I have with the new update so far is that when you are in stealth(which is central to my game), when you jump it returns you to non stealth mode, which will get players busted by my enemies, jumping to a rooftop or over a fence, ect...

    Ya might allow players to toggle off stealth, when they attack, or something, but allow them to jump and climb without leaving it.

    Just a thought.

    Thanks.

    Kuro.
     
  30. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,382
    Thanks for the kind works Kuro! It's cool knowing people are using these tools in their games.

    What you're saying about going in and out of stealth makes sense. I'm starting to get into a weird spot where enough people are using it that I don't want to mess up someone else who is now using it the way it is, but you've got an interesting point. Maybe an option flag or something. I'll have to think about it more.
     
  31. kurotatsu

    kurotatsu

    Joined:
    May 10, 2012
    Posts:
    588
    Here's my original development gameplay(which is lacking.lol:D):

     
  32. kurotatsu

    kurotatsu

    Joined:
    May 10, 2012
    Posts:
    588
    And here's our stealthkilling hero with your 2 systems.:D

    [[video=youtube_share;svZeqaLNHUY]http://youtu.be/svZeqaLNHUY

    I can't wait to implement so more of his original movement using your system, just wanted to toss some ideas your way.

    Needs a better run with sword animation.lol

    This isn't a hijack, mind you this is showing you what you bring to other people.

    I want you to know how grateful I am you made these 2 systems. And what you are doing is making a difference.
     
    Last edited: Apr 10, 2014
  33. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,382
    Kurotatsu, that's awesome! It's so cool to see other people's characters using the system. Your guy is really looking great (and I love stealth games).

    The other thing that hits me is that us mini-indie are really able to do a lot if we can leverage each other. I was checking out UMA last night and some shader systems. No way we could do everything ourselves. Having something like the Unity Asset Store really 'ups' the quality and capabilities of all our games.

    Definitely a cool time to be an indie.
     
  34. kurotatsu

    kurotatsu

    Joined:
    May 10, 2012
    Posts:
    588
    I agree totally.:D

    I've been writing my scripts(not to mention art assets) with a mind towards making them drag and drop for future games, and will eventually put my different systems together in a generic non specific format for others to use in their games.

    I'm glad you enjoyed the video, I'll post more in the future as I hit milestones for others to see what's capable with your systems used in concert with one another.(Just bought your mount points asset, that will be in a video as well once I incorporate it into my inventory system.)

    Edit:

    Do you have it scripted yet to use the punch layer, I searched the input script, and motion control.cs but found nothing for punch.

    I'm trying to see a working example so I can implement attacks.
     
    Last edited: Apr 13, 2014
  35. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,382
    Definitely looking forward to seeing them!

    That goes for everyone. Don't be shy about sharing what you're doing. I think it helps everyone to see what others are up to and how they've implemented things.

    Actually, the latest release has the punch active and it runs on the second layer. Search the InputManager.cs for "PrimaryAttack". Somethings I've learned though is that the Unity masks don't handle the spine bone well. If you put your attacks on the layer and mask out the legs, it doesn't look natural. Unfortunately, there's nothing I can do about that.

    When I get to that point for our game, I think I'm going to do full body combat motions. I'm going for something similar to Batman Arkham.

    If anyone has any experience with with this, please share.
     
  36. PlayingKarrde

    PlayingKarrde

    Joined:
    Aug 19, 2013
    Posts:
    35
    If you're planning on doing melee combat then 100% you should be using full body motions. Masks and layers are good for things like ranged combat, but look terrible for melee. Haven't really seen a third person game use layered animation for melee... probably ever.
     
  37. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,382
    Thanks PK, good advice.
     
  38. kurotatsu

    kurotatsu

    Joined:
    May 10, 2012
    Posts:
    588


    Found it, thx.

    Having issues getting it to play, I put in my own input and it doesn't work, and trying the mouse input doesn't play either, I'm not sur if I might have messed up a transition possibly?
     
  39. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,382
    Weird.

    I just created a new project, downloaded and imported the Motion Controller, unzipped the InputManager.asset, and ran the 'demo' scene. The punch worked with the left mouse button or 'B' button on the Xbox controller.

    In your scene, do you have 'Punch' as a motion on a second Motion Layer? Make sure that second motion layer has a '1' for the Animation Layer property.

    If that doesn't work, shoot me an email at tim@ootii.com. Maybe it has to do with a change.
     
  40. kurotatsu

    kurotatsu

    Joined:
    May 10, 2012
    Posts:
    588
    Nvm, in an effort to see if it was something I did(which it was I'm certain.lol), I started a fresh project and imported the motion controller, and all is working now.

    PK, has a sound argument, as my melee atks will be mostly full body, though I think layered could still become handy if a person is using a targeting system(Adv cam/Motion controller update perhaps;)).

    An example being combat like in Zelda: Ocarina of time, where when targeting a foe, one strafes around them, and dodge/rolls left and right.

    Just food for thought.

    I noticed you can spam the attack button, a timer waiting until your current anim is finished might be in order. Aaaaand if one is adding timers one might consider a counter like a 3 hit combo option.:D

    EDIT:

    I didn't set the fighting layer on motion controller when I put it on my character, copy and pasted the one off of the demo avatar, and now he attacks, duh.lol

    I'm an idiot.

    EDIT(the sequel):

    I don't want to edit your scripts too much because that creates a nightmare when I update your system, then I have to find and remake the changes to the new scripts.

    That being said, I was wondering if you could expose and connect the grounded bool in the animator as it would be nice for using as a condition to make transitions.

    I also noticed since the fighting layer overrides the base layer, you can attack as you enter a ledge/hang, and your avatar will plant his feet like he's grabbed the ledge while his upper body still will finish the attack.

    Never let any of this get you down, you have a solid system, I'm just trying to help debug as a VERY satisfied customer/tester.:D
     
    Last edited: Apr 15, 2014
  41. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,382
    Awesome. Yeah, happens to me sometimes too. I hate sending a 'help' message only to find the answer 10 seconds later.

    I like combos as well. One thing I keep thinking about is what should be in the Motion Controller and what shouldn't. I like componetizing things and having clear lines. Since we're talking about a combat system (which tends to be larger than the individual avatars), I'm not sure where pieces like the combo system go yet... interesting stuff.

    haha... You're right on the punch while climbing. I'll have to put in some limiters. To be honest, I didn't really expect anyone to use the punch as is. It was more an example of the different layers. But, you're right about limiting when it can be used.

    I'll have to look. You should be able to get all the grounding information from the state object. That's the safest place as I do checks outside of what Unity's character controller or the Animator does. Maybe I'm misunderstanding. If so, please clarify.

    Definitely not. The whole community has been awesome and the feedback is great. As long as people are constructive (as you are), I appreciate the bug reports, criticisms, and ideas.
     
  42. kurotatsu

    kurotatsu

    Joined:
    May 10, 2012
    Posts:
    588
    In my previous animation and movement script from waaay back a week ago while using Unity 3.5;), I had a bool called ledged to limit what was possible during a ledge/hang as I had similar issues.

    Just considering putting in a double jump like in my first video, and if I have a grounded bool to pull from in the animator I can set up a jump attack while not grounded as well.

    Here's an excerpt from my old movement script that'll give ya idea the direction I'm thinking (This also allowed my character to change direction on his second jump as well. ):

    Code (csharp):
    1.         if (Input.GetKeyUp(KeyCode.JoystickButton0)  grounded == false  ledged == false  canDouble == true) {
    2.             gravity = gravityReset;
    3.             moveDirection = new Vector3(Input.GetAxis("Joy1 Axis 1"), 0, Input.GetAxis("Joy1 Axis 2"));
    4.             moveDirection = Character.TransformDirection(moveDirection) * (jumpSpeed / 2);
    5.             moveDirection.y = jumpSpeed;
    6.             player_obj.SendMessage("DoubleJump",SendMessageOptions.DontRequireReceiver);
    7.             forceJumpCharging = false;
    8.             jumpChargeCurrent = 0;
    9.             canDouble = false;
    10. //          Invoke("doublejumpBurst",.1f);
    11.             //          Instantiate(doubleJumpBurstParticles,this.transform.position,this.transform.rotation);
    12.            
    13.         }


    EDIT:
    This portion is from my charged/focused super jump in the video, don't worry about it.lol
    Code (csharp):
    1.             forceJumpCharging = false;
    2.             jumpChargeCurrent = 0;


    I keep my movement, player_atk, and animations all in separate scripts(hence the send messege portion.8) of the code), so implementing your systems is a breeze thus far.

    If you'd like to see any of my old movement script for ideas, pm me.(Though you are a far more competent coder than I.lol, it's nice sometimes to have something to reverse engineer.)
     
    Last edited: Apr 15, 2014
  43. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,382
    I see what you're saying.

    For the basic double jump, all the pieces should be there for you.

    In the 'if' statement, you've got 'grounded == false'. All you need to do in a motion is replace it with 'mController.IsGrounded == false'. This is short cut for checking the state itself.

    Going off of the current Jump motion, you'd just add a little extra physics impulse (see line 253):
    mController.AddImpulse(lImpulse * 0.5f);

    You'd probably want to transition back into the rise state as well. So, you could do that with:
    mController.SetAnimatorMotionPhase(mAnimatorLayerIndex, Jump.PHASE_START_JUMP, true);

    With these three additions, you should be able to implement a basic double jump. I haven't tried it, but it should be close.

    The ledge check makes sense too. You'd have to first see if you're in a climb motion. If so, there's an 'IsInClimbIdleState' you could make public and look for. That would get close to the ledge check.

    Hope that all makes sense.
     
    rubble1 likes this.
  44. kurotatsu

    kurotatsu

    Joined:
    May 10, 2012
    Posts:
    588
    It certainly does. thanks.

    For others following the discussion, here's some tips on adding 2 attacks based on speed of your characters movement.:

    On the fighting layer double click Punch-SM then inside:

    =======================================

    I've added a regular attack(covers idle, and walking) for the punch, in the transition from anystate to punch you have to set the conditions to:

    L1 Motion Phase (Equals) 500

    and

    Input Magnitude (Less than) 0.85

    Add and exit transition to (UP) Fighting with a condition set to:

    Exit time (0.75)

    =======================================
    Copy the punch and rename and then:

    I've added a running attack(covers running) for the new punch state, add your new animation, in the transition you have the conditions set to:

    L1 Motion Phase (Equals) 500

    and

    Input Magnitude (Greater than) 0.85

    Add and exit transition to (UP) Fighting with a condition set to:

    Exit time (0.75)

    =======================================

    Now you will have 2 attacks based on your characters speed.

    I'll post another video once I've added a jump attack and a double jump to show progress.

    Hope this helps,

    Kuro.:cool:
     
  45. kurotatsu

    kurotatsu

    Joined:
    May 10, 2012
    Posts:
    588
    I matched my character to the same size as the default avatar and everything thing works as it should, except once he jumps the collider reset portion of the code resets his collider wrong.

    I realize the need to have the character match yours to make raycasts and the like correctly placed for things like collision detection and such, but as developers use a variety of different models things of this nature hard coded will cause many complaints down the road.

    You might consider making the height reliant code a little more user friendly to work off what ever the customer sets his/her model's character controller height, rather than the hard coded 1.8f, otherwise everything will work right until they make their first jump.

    I reimported my model at different scales trying to compensate for this, but alas it doesn't help.
     
  46. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,382
    Yeah, after working with the goblin it was an issue for me as well and I've fixed it to be variable. I plan on pushing it out tomorrow, but it usually takes Unity a week to update.

    If you need the changes now, email me at tim@ootii.com and I'll send you the updated files.
     
  47. kurotatsu

    kurotatsu

    Joined:
    May 10, 2012
    Posts:
    588
    Thx, you're the best. I was freakin trying ta figure out,"Now why won't my guy walk under this ramp in the demo and the default avatar could".lol
     
  48. 3

    3

    Joined:
    Sep 16, 2012
    Posts:
    387
    Hey Tim,

    just wonderin, you still plan on releasing new motions? I am not quite as good at making em as I thought I would be, and I really could use a shooting motion,

    thanks!
     
  49. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,382
    Hey Kurotatsu, I just sent an email with the info. Sorry for the delay. We were out celebrating my daughter's birthday. :)


    Hey 3,

    I do. The big challenge is that I have to make some progress on our game. With the Motion Controller being out just over 5 weeks with 5 updates, my focus has really been on bug fixes, adding the tutorials, and the couple of new motions I did release.

    When I do release motions, they will be focused on what I need for our game which is a fantasy based action-adventure. Think rope climbs, crawling, sword fighting, etc. Shooting and swimming aren't really a priority for me though.

    I'm sad to hear creating motions didn't work out. Please feel free to email tim@ootii.com anytime. I'm happy to help you think through logic or point you in the right direction. I've been doing that for about 5 others. If the challenge is the raw animations themselves, I'm afraid I'll be less helpful.

    My hope really is that people can use the Motion Controller to build the motions they need, but I understand were all at different levels when it comes to animations and coding.
     
  50. 3

    3

    Joined:
    Sep 16, 2012
    Posts:
    387
    Congrats on your daughter's birthday!

    Anyways, Haha, a programmer on my team and I just figured it out somehow, a lot easier then I thought it would be, I'm just wondering if when I update the system will I lose all the motions I have made so far? And will I not be able to implement your new motions into the ones i've added?

    Also, do you have any suggestions on how to move the character upwards and downwards naturally when in Walk360? Think like aiming up and down on a first person shooter.

    Lastly, is the Zoom button supposed to be activated by a middle click? And am I required to hold down the right mouse to orbit with the adventure camera?
    Stupid question that could be solved with 5 minutes of research, but I'm lazy, how can I change these two settings?

    Sorry for asking so much!
    Thank you so much for the consistant support
     
    Last edited: Apr 18, 2014
unityunity