Search Unity

Motion Controller

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

  1. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    Awesome. Sounds great.
     
  2. recon0303

    recon0303

    Joined:
    Apr 20, 2014
    Posts:
    1,634

    let me know if you need animations......I can make them. if need be.
     
    kurotatsu, Tryz and TeagansDad like this.
  3. recon0303

    recon0303

    Joined:
    Apr 20, 2014
    Posts:
    1,634

    2 is not great, which is what we have tried...Not a fan at all....

    1 AND 3 , I would suggest..... Not sure how long it would take you?? why not just do 1 an 3 with the pack for different people?? Just a thought.. I'm building for mobile, so 2 wouldn't work at all for me.. I have tried.. . Also for networking, for some it could cause issues..


    So I think 1 and 3 could help people for different games, and situations. In my opinion. I know I have made games in Unity with # 2 and always missed alot, and was not that great.. Networking I would think its worse.

    I know in Gloria Victis they have alot of issues with this..

    PS: Or you could do all 3 , for different games, and situations, it may come down to this, hate to say it, I doubt everyone would be 100% happy since different games, and platforms will matter. Sadly. But again depends what you want to do.:)
     
    Last edited: Nov 11, 2016
    hopeful, Tryz and TeagansDad like this.
  4. recon0303

    recon0303

    Joined:
    Apr 20, 2014
    Posts:
    1,634

    I been working with one as well. Ya if you run into any weird issue would love to know, I have here and there, but nothing so far I haven't been able to fix , I forget some fixes, sometimes, like the bumper trick. and stuff like that lol... for slopes, but anything else, let me know too.
     
    Tryz likes this.
  5. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    I'm finding the Mixamo S&S animations are a bit rougher than I hoped. So, I'm trying my best to blend them.

    If you want to give one a try, how about a backwards dodge. I'd like something that jumps or rolls the player backwards out of the way of an incoming attack.

    I use Y_Bot@sword_and_shield_idle (frame 0) as the base idle pose. So, he'd start the dodge from there and end there too.

    It isn't critical, but it would be helpful. :)

    I've got #1 and #2 working pretty well. That should give people an option.

    I've had some delays this week, but I'm hoping to have another video soon.
     
    TeagansDad and magique like this.
  6. kurotatsu

    kurotatsu

    Joined:
    May 10, 2012
    Posts:
    588
    A back stroke, and left and right stroke for the swimming, would be a couple I'd suggest.lol(I've been thinking about a fwdroll>treading Idle anim as well for when the character hits the water.)

    I'm about to dust off Blender and try my hand at it again, too.
     
  7. recon0303

    recon0303

    Joined:
    Apr 20, 2014
    Posts:
    1,634
    Please also send me some videos if possible of any animations you may have scene in a game to give me idea, if not, give me details, in depth. Thanks.
     
  8. recon0303

    recon0303

    Joined:
    Apr 20, 2014
    Posts:
    1,634
    Just found out number 3 will be better for Bolt and Networking, more so.

    lag compensated hit detection rays :) (BoltNetwork.Raycast)
     
    antoripa likes this.
  9. reocwolf

    reocwolf

    Joined:
    Aug 1, 2013
    Posts:
    182
    Man can't wait for this one! I'm excited about shooter too.
     
    Tryz likes this.
  10. reocwolf

    reocwolf

    Joined:
    Aug 1, 2013
    Posts:
    182
    ellie-aims-bow-at-animal.jpg I was wondering how to go about showing the predictive trajectory for the projectiles. I'm not working on this but might do later this month. Want to try to do something like TLOU.
     
  11. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    The arrows are just using Unity's physics (Rigidbody + impulse + gravity). If you know the arrow's starting point (which we do), you should be able to do the math and generate a path. The only thing that might throw a wrinkle is if Unity's Rigidbody does math beyond normal physics.

    Just remember that horizontal and vertical (for gravity) equations are two separate calculations... just like in the real world. :)

    The other option would be to shoot an invisible projectile and let the Rigidbody do all the work. However, that takes time.
     
  12. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Cool! I'll look for one and post.

    Interesting. I would have expected #1 would be better.

    I'm too far down the road now to do #3, but #1 and #2 are working well. :)
     
    Last edited: Nov 12, 2016
  13. recon0303

    recon0303

    Joined:
    Apr 20, 2014
    Posts:
    1,634

    Ya that is just what I been told about people that are better at networking than myself, I'm still learning Networking myself, and have been for a few years on and off... More off, but some people I talk to tell me this with Bolt. anyways.. 2# for sure I knew would be an issue, for Networking, since even single player its misses alot. But may work for some people ...

    Ya, would be great to see number 3# if possible, I plan to buy your packs even if I don t use them all. But I really want to use the sword and shield, but with out number 3# sadly it would be useless to me for the game I'm working on, I know you can't please everyone, and I don't expect you to add it just for me, but for anyone using Bolt #3 would be the only way from my understanding.

    Edit, I talk to Stanchion, should be able to use number #1. I know 2 is out of the question. So that is good news.
     
    Last edited: Nov 13, 2016
    Tryz likes this.
  14. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Here's an update on the Sword & Shield Motion Pack:



    I've got to make sure the other attack styles work and do a ton of testing, but I like it... :)
     
  15. kurotatsu

    kurotatsu

    Joined:
    May 10, 2012
    Posts:
    588
    Loving what I'm seeing thus far, especially the attacking non rigidbody collider option.

    the lock on for Archery pack will be awesome.

    I really like the NPC change, I'll try it in my AI when I get a chance.
     
    TeagansDad and Tryz like this.
  16. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,684
    Too awesome! Mind blown!!! :)

    FWIW, as mentioned before I plan to use a "to hit roll vs def" rule based method of determining hits, but I want to use a framework like you have above to act out the pre-determined results. So if the rules say a character was hit, then the animations play out a hit, or if the rules call for a block or dodge, then the animations play out for a missed shot or swing, and either the shield blocks or the character dodges. Hopefully that sort of scenario can play out using the motion pack without too much jiggering. ;)
     
    TeagansDad likes this.
  17. sxnorthrop

    sxnorthrop

    Joined:
    Sep 29, 2014
    Posts:
    43
    Hi guys!

    I've been running into sort of an issue / concept that I'm having a bit of trouble with. I was hoping you guys could help me out a bit, it would be much appreciated!

    The video below shows my dilemma:


    I didn't really explain all of it correctly, but I hope you guys understand what I'm getting at.
     
    rubble1 likes this.
  18. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Actually, it should be pretty easy.

    Each character has a 'Combatant' component. All processing goes through its' functions: PreAttack(), PostAttack(), Attacked(). Basically, I pass a 'CombatMessage' around through these functions.

    So, you can create your own 'Combatant' that can process those functions and change the CombatMessage that tracks what is happening. It will make more sense once I have documentation, but it should work fine for you.
     
  19. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    I believe it's me, not you. :(

    In my test scene, I can walk the character up the wall and onto the ceiling and everything is working as expected. However, I put together a rotating platform (around the x-axis) and it looks like he is over compensating. So, I'll look into that.

    If that was working, setting these properties on the AC would get you what you want:
    Gravity Is Relative = true
    Orient To Ground = true
    Keep Orientation = true

    Let me dig more into the platform rotation and see what's going on.
     
  20. sxnorthrop

    sxnorthrop

    Joined:
    Sep 29, 2014
    Posts:
    43
    Thanks so much, man!
     
  21. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    No problem.

    Two quick things I just noticed in your video:

    1. The AC doesn't have "Is Relative" checked (in the gravity section). You want that checked so, the character will always be pulled down to his feet (vs. Vector.down). This way, if he's upside down, gravity will still be towards his feet (which are up in this case).

    I hope that makes sense.

    When this is checked with Orient To Ground, we can wall-walk. With Keep Orientation checked, when he jumps he'll remember his last orientation and not revert to the typical ground.

    2. When trying to force the orientation (that's what I call tilting vs rotating-around-the-yaw), you want to use the AC's SetTargetGroundNormal(). Basically, that will force his orientation to the vector parameter instead of the ground normal under his feet.

    That said, I still have an issue of over-compensating when the platform rotates (and you shouldn't have to use SetTargetGroundNormal in this case) But, I thought this might help some.
     
  22. sxnorthrop

    sxnorthrop

    Joined:
    Sep 29, 2014
    Posts:
    43
    Thank you. That helps me out a bit, and you explained it pretty well so I understand what's going on. If the rotation was working, then this is going to complete a milestone for our game. I just got to say though, you're a genius (not sure if you have a team or not) but me and my friend are really happy with our investment.

    Again, thanks!
     
    rubble1, Tryz, TeagansDad and 2 others like this.
  23. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Last edited: Nov 16, 2016
  24. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    Tim,

    I watched your example sword & shield combat video and I have some questions/comments.

    First, can you make it so that a shield block has a parameter for how much damage it suppresses? IN some cases it would be useful to not have a block fully absorb all damage. Some attacks may partially get through due to the nature of the attack or maybe because the shield is damaged and not working at full capacity.

    Second, it doesn't look like there is a way to define combo attacks. I see you can switch styles, but then the character always uses that style. It would be very beneficial to have multiple attacks in a row cycle through a sequence of attacks that could end in a big finishing attack. You would have to do those attacks rapidly in succession otherwise the sequence would restart. or perhaps getting hit by an enemy would reset it as well.
     
    kurotatsu and Tryz like this.
  25. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957
    @magique - I'm not sure if/how combos will work in the S&S pack, but if it's not built in it's not overly difficult to add. I modified the attack motion in the Sword Animset Pro set on the Motion Vault to cycle through a simple attack routine (and reset if the input was too late).
     
    antoripa and Tryz like this.
  26. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Good comments!

    Yes. I actually have two values...

    1. The amount of damage the shield reduces per hit (as a percentage).

    2. The amount of hit-points the shield has. When the shield absorbs this number of hit points, the stance is broken and you have to re-enter it.

    Actually, I just added something today.

    Some styles have a time-frame where another attack can occur. That 'next style' is predetermined by the current style. Currently, I have the forward and back swings using this approach. So, as long as your timing is perfect, you can immediately go back and forth.

    You can add new animation events (there's a begin and end time). That's the click window to go to the next attack in the combo. You could link any number of attacks this way.

    So, there's some customization you can do. However, I don't have a super complex combo system.

    Since I expect people will have lots of different game play styles, I'm trying to make sure you can customize and override most everything to your liking. I expect more advanced combo systems may even require me to add some extra hooks... and I'm happy to.
     
  27. DanielKW

    DanielKW

    Joined:
    Nov 11, 2014
    Posts:
    38
    A weapon-by
    -weapon moveset function would be cool for example, in this dark souls video:
     
    recon0303 and Tryz like this.
  28. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    I agree. I'm moving in that direction, but I'm always limited by the animations I can get (and can give way).
     
  29. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    I tried searching around and I can't find a video of what I'm thinking.

    So, here's my thoughts...

    I just want to try something simple.

    The goal is the for the character to dodge backwards out of the way of an incoming attack.

    In Dark Souls, the character does a 180 turn, a roll, and then turns back to the target. Instead of something that fancy, I just want the character to keep facing forward, but do a quick leap backwards... about 2 feet.

    I tend to like more realistic (but exaggerated) movements. So, the character would:
    1. Quickly squat a tiny bit (mostly the knees)
    2. Leap backwards while keeping his shield in front.
    3. His leap is mostly horizontal (2 feet-ish) and wouldn't have much height at all.
    4. The recovery would have some weight. When he comes to his new stopping position, he'd bend his knees a bit and come back to the idle.

    All of this would be quick. Maybe the span of a second... since he's in combat and ready for the next attack.

    The character is in the S&S Idle pose:
    https://www.mixamo.com/store/#/search?page=1&type=Motion%2CMotionPack&query=sword%20shield%20idle



    The player is locked onto the target and holds the 'S' key to move backwards. At the same time, he presses the 'Space' key to jump. This would cause him to dodge backwards.

    I hope that helps.

    I totally get this is an experiment and I'm not holding up the S&S work for it. So, if you can get to it, that would be awesome! If not, I totally understand. :)
     
    magique likes this.
  30. recon0303

    recon0303

    Joined:
    Apr 20, 2014
    Posts:
    1,634

    I think I see where you are going with this... Do you want me to start with a certain animation? or I can just do the one you are asking, and you can blend it your self?? I can just do the animation, sounds like you want the animation to leap back a few feet while facing forward to avoid a hit? correct? If not correct me if I'm wrong.
     
    Tryz likes this.
  31. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Exactly. Nothing too complex or fancy.

    My base idle is Mixamo's sword_and_shield_idle animation frame (0.0 to 0.1)


    https://www.mixamo.com/store/#/search?query=sword%20and%20shield%20idle
    (It's the one with the least amount of movement)

    If you can start from this, that would be great. Even if you're just close, I can blend the rest.

    I'm excited to see how this goes. :)
     
    magique, TeagansDad and antoripa like this.
  32. recon0303

    recon0303

    Joined:
    Apr 20, 2014
    Posts:
    1,634
    Sounds good bare with me, it will take me a little bit of time, but I will get something soon as I can. I will send it to your email and your welcome to give me an honest feedback on any change you want/need. ,, It happens with animations when your trying to see what someone wants. So once I send it just give me some details on any changes. Thanks.
     
    kurotatsu and Tryz like this.
  33. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    No problem! Thanks :)
     
  34. devstudent14

    devstudent14

    Joined:
    Feb 18, 2014
    Posts:
    133
    Trying to get motion controller to work. The demo scene is easy, but do you have any tutorials explaining how to get motion controller to work with a different skeleton? When I press play, my character just starts racing backwards. I tried changing my character's skeleton to humanoid, adding the Humanoid controller and the jones avatar, and clicking 'create from other' in the avatar options. The results are a bit crazy:

    upload_2016-11-18_11-10-10.png

    The skeleton issue is probably just some scaling problem, but solving that wouldn't explain why the character is traveling backwards at tremendous speed. This backwards movement happened before I started playing around with controllers, rig types, and avatars and simply had my original model with a generic rig and its own controller.
     
  35. Tryz

    Tryz

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

    When you import your FBX as 'humanoid', you'll get your own custom avatar. You need to use that as Unity generates the avatars for each specific FBX/Skeleton. That's the bridge Unity creates between your unique character and Mecanim.
    So, you can't use the Jones avatar as Unity built that specifically for Mixamo's character. If you do, you'll get all kinds of crazy results.

    If you're using your own avatar from your FBX, that seems odd. You may need to look at the 'Rig' settings and see if Unity is having a hard time reading your FBX.

    I'm not sure how familiar you are with Unity's animator and Mecanim, but these may help:
    https://docs.unity3d.com/Manual/AvatarCreationandSetup.html
    https://unity3d.com/learn/tutorials/topics/animation/humanoid-avatars


    As long as you bring your FBX in as a valid 'humanoid', it will just work. In fact, I'm just leveraging Unity's Animator setup. I've used skeletons from Mixamo, Morph3D, UMA, and other characters off the asset store. So, there shouldn't be any surprises (as long as your skeleton imports cleanly as a 'humanoid').
     
    Last edited: Nov 18, 2016
    TeagansDad and devstudent14 like this.
  36. devstudent14

    devstudent14

    Joined:
    Feb 18, 2014
    Posts:
    133
    @Tryz. Thanks for the tip about the avatar. Here are my steps:

    1. go to fbx file and change rig type to humanoid.
    2. in avatar definition, select 'create from this model'.
    3. check out the configure screen, everything is green and good to go.
    4. add the custom avatar to the character.
    5. add the Humanoid controller that comes with MC to the character's animator.
    6. add the MC component.
    7. select the MMO option, and select jump and climb
    8. press play
    9. watch character move backwards at amazing speed, no response to keys and no animations being played :(
     
    Tryz likes this.
  37. devstudent14

    devstudent14

    Joined:
    Feb 18, 2014
    Posts:
    133
    Ok, I've got the character moving around at least, but still no animation. I think this is similar to the mount points issue. I'm going to spend some time digging around blender/unity forums for a solution. I don't think this issue has anything to do with your asset.
     
    Tryz likes this.
  38. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Go ahead and email me your character FBX and I'll take a look. I think something isn't importing correctly.

    Please email it to tim@ootii.com.


    The other thing you can do is just click on one of my animations like:
    Assets\ootii\MotionController\Content\Animations\Humanoid\Running\RunForward\RunForward

    In your inspector, you should see a character in the preview window. Now, drag your character into the preview window. Now Unity will use your character with the animations. If you press play in the preview window, what happens?
     
    devstudent14 likes this.
  39. devstudent14

    devstudent14

    Joined:
    Feb 18, 2014
    Posts:
    133
    It works well with the animations in the preview screen. I've made a dodgy custom controller so I know I can import an FBX into Unity and get it moving around in a primitive way.
     
  40. devstudent14

    devstudent14

    Joined:
    Feb 18, 2014
    Posts:
    133
    Ok, finally. I tried everything, but the only thing that worked was exporting it to Max, and then exporting from Max to Unity. Obviously something is lost when exporting from Blender to Unity directly. What that is exactly I have no idea.
     
    Tryz likes this.
  41. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    I'm glad it's working, but... WOW!

    I'm sorry you had to go through all that.

    I did a quick search on Google for "unity blender character issues" and a fair amount of stuff popped up. There may be something there that explains it, but Blender and Unity don't seem like friends. :(

    This looks like it might help:
    https://docs.unity3d.com/Manual/BlenderAndRigify.html
     
    TeagansDad and devstudent14 like this.
  42. devstudent14

    devstudent14

    Joined:
    Feb 18, 2014
    Posts:
    133
    Cheers :) I've been putting off switching 3D programs, but I think this is a sign that mastering Max would be a wise investment of time.
     
    kurotatsu, TeagansDad and Tryz like this.
  43. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957
    @mattockman - it probably would be.

    I learned 3D modeling using Maya, and then I used Max when I worked in the industry. I've tried to learn Blender a few times, but it just doesn't click with me. I don't know how you guys cope with that interface. ;)

    There do seem to be more issues importing rigged models from Blender than there are with Maya or Max (although I'm definitely not an expert there).
     
  44. devstudent14

    devstudent14

    Joined:
    Feb 18, 2014
    Posts:
    133
    @TeagansDad I wish I had started with Maya! Switching two and half years in is rough.

    Still not having much luck even exporting from Max though. I feel like a real pain, but I'm not sure why no one else is getting this problem. I just got it to work, then the mount points broke, so I went back to fiddling around with importing from Max and now the character is traveling backwards infinitely while playing the falling animation. I fine depiction of my general mood right now.

    I'll leave the file with any wise soul who wants to take a crack at it! I admit defeat -_-

    Here's my email: owen.brown@griffithuni.edu.au

    Email me and I'll share the file with you via google drive.
     
  45. ikazrima

    ikazrima

    Joined:
    Feb 11, 2014
    Posts:
    320
    @mattockman

    I've had Blender crashing Unity when importing, just because I switched from 2.6 to 2.7.
    Imported the FBX from Blender into Max, reexport, import into Unity and then... crash.
    Rest assured (?) you're not the only facing problems when dealing with characters from Blender.

    I have MC but haven't tried integrating with any Blender rigs yet, so can't help on that end.
     
    Tryz and devstudent14 like this.
  46. devstudent14

    devstudent14

    Joined:
    Feb 18, 2014
    Posts:
    133
    Ok, I've really got it this time. My last words on the matter: both Mount Points and Motion Controller work beautifully and intuitively if done completely through Max and Mixamo (or Maya -I don't use that, just assuming).

    It's ok to make a mesh in Blender, but for the love of god DO NOT use anything rigged in Blender with Mecanim. It works sometimes when some obscure series of conditions are met, but then it stops working and you end up watching totally confounding behaviour for hours. Despite about seven hours of effort, I didn't manage to get both MC and MP working simultaneously with a Blender import. I got things set up using Max perfectly in about thirty minutes, and that's including the time it took to rig the model in Mixamo.

    I shall never make a post about Blender on these forums again -_-

    Thanks for all the help and feedback :) Looks like this is a pretty awesome community.
     
    TeagansDad, Tryz and FargleBargle like this.
  47. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    I'm sorry Blender was so painful, but I'm glad you're up and running. :)
     
    devstudent14 and TeagansDad like this.
  48. kurotatsu

    kurotatsu

    Joined:
    May 10, 2012
    Posts:
    588
    My workflow from blender(I still use an ancient 2.49 version) is to model my character, and rig them in mixamo's autorigger.
     
    Tryz likes this.
  49. recon0303

    recon0303

    Joined:
    Apr 20, 2014
    Posts:
    1,634

    yes this can happen, I have had this issue with Modo to Unity before, exporting, from a 3d program to Unity tends to bug out, I think its a Unity export issue personally, since I had this happen in Modo, Blender, and someone on my team was using Maya, and same issue. before..... All you can do as you seen is re-export it from your 3d program to Unity..

    I have had this happen when skin weights to, when I have clipping with clothing when its fine in the 3d program and in Unity its screwed... Has to be Unity.... I even exported to Unreal and was fine..So that should tell you that its Unity..
     
    Tryz likes this.
  50. recon0303

    recon0303

    Joined:
    Apr 20, 2014
    Posts:
    1,634

    Sound like me, I started with Max, them Maya, now I own the all, moved to Modo a few years ago .
    but I like Modo way better....Animation wise I like Maya still. but hate the whole sub thing... I like buying my tools. But Modo has come along ways and love the modeling tools, way better in my opinion that all of them... Maya and Max are still great tools. Just wish Auto Desk wasn't so greedy.. and had subs for people who like them, and you can buy the program when ever you want.. Adobe same way, I own CS6, and refuse to use CC..
     
    Tryz likes this.