Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Motion Controller

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

  1. Anflo

    Anflo

    Joined:
    Dec 3, 2014
    Posts:
    17
    Where can we find a list for the Messages ID and their corresponding animations so we can trigger them in Nodecanvas
     
  2. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957
    There are currently two places where you can find them; I believe that the "correct" place is Assets\ootii\Framework_v1\Code\Messages\EnumMessageID.cs

    Some of the classes and motions get the ID as a static field on the specific message type itself (i.e. CombatMessage). But all of those values are also found in EnumMessageID.
     
    Tryz likes this.
  3. MaliceA4Thought

    MaliceA4Thought

    Joined:
    Feb 25, 2011
    Posts:
    406
    Hello, me again :)

    Two quick questions...

    I updated my various ootii packs to the new versions. I am using the 3rd person views and controllers. My character has basic motion controller and worked fine using the right hand mouse button to steer the character and rotate the camera.

    Having added the Swords and Shields pack, when I use the right mouse button to steer the character and I release the RMB theres a distinct jump in the character.. the smooth motion of going back to normal straight line movement is gone.

    I tried this on an empty project and got the same effect. (am on 2017.3 Unity).

    Second, has anyone integrated ootii motion controller and packs with Emerald AI and if so, what changes did you have to make to get damage from the SSP into Emerald?

    Many thanks in advance.

    EDIT :- Damn :) within 2 minutes of posting this, I got an email from the unity forums saying that the next integration that Emerald is working on is for ootii motion controller, so lets just skip the second question shall we? :)

    M
     
  4. Anflo

    Anflo

    Joined:
    Dec 3, 2014
    Posts:
    17

    I am trying to trigger an animation from NodeCanvas using those IDs but to not success . The example provided "NavigationMessage, 10" does work but none of the other I try.

    Screen Shot 2018-01-23 at 08.08.39.png Screen Shot 2018-01-23 at 08.09.18.png Screen Shot 2018-01-23 at 08.08.39.png Screen Shot 2018-01-23 at 08.09.18.png
     
  5. francescobr

    francescobr

    Joined:
    Apr 2, 2017
    Posts:
    45
    Hi, I was looking into your controller. Then I read this. Are you talking about polish or is it really that hard to swap other animations in? I was just thinking about kubold's...
     
  6. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    It's not hard to swap animations. For things like walk animations, it really is just a simple replace in the animator.

    The post you referenced was in response to someone saying they swapped out the archery animations and things didn't just work. That's because the archery system expects a specific flow; draw, pull, release, recover, etc. In the release animation there's a Unity animation event that is required for the arrow to be launched.

    So, in the case of a 'system' like that there may be some work to make sure the new animations fit the flow and the animation events exist. I wouldn't call that hard, but you probably do have to be aware and do some tweaking.
     
  7. francescobr

    francescobr

    Joined:
    Apr 2, 2017
    Posts:
    45
    I understand. So I might buy the sword and shield motion pack and just swap in kubold's animations, those should be easier than archery, right?
     
  8. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    I don't believe either are hard, but I do want to set expectations.

    You just have to think about what's happening in the system. For example, lets say you want to replace a single sword swing. That's easy in itself...

    But, what if Kubold animation set has the character's right foot forward while Mixamo has the left foot forward? When he swings his feet will blend along with the sword swing and that may not look good. So, you may want to use Kubold's sword idle animation too. That means you probably want to use Kubod's sword equip animation too (so you end in the new idle). Etc.

    I'm not trying to scare you way and I don't think any of this is hard. It's just that when we're building games, we have to think of the "system" and how one change might lead to another. :)

    In some of these animation swaps, you will have to setup the animation events that I use in my animations. It's easy, but it's another task to remember. I talk about them in the User's Guide on page 13:
    http://www.ootii.com/Unity/MotionControllerPacks/SwordShield/SwordShieldUsersGuide.pdf
     
  9. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    You can also find them on the documentation site I'm building out:
    https://ootiigames.com/?p=473
     
  10. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Not all motions will activate due to a message. That's a newer features that some older motions don't know about yet.

    What I talk about in most videos and documentation is to use the MC.ActivateMotion() function. That will work with all motions.

    Check out the example on page 30 of the User's Guide. That gives some examples.

    For a jump, you can do this:

    Code (CSharp):
    1. MotionControllerMotion lMotion = mMotionController.GetMotion(0, "MyJump");
    2. mMotionController.ActivateMotion(lMotion);
     
  11. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    I see what you're saying and found the bug.

    I've got a fix for the next update. If you want it before then, feel free to email tim@ootii.com.

    Thanks! :)
     
    MaliceA4Thought likes this.
  12. christougher

    christougher

    Joined:
    Mar 6, 2015
    Posts:
    558
    Tim is too modest. Truthfully, I'd say yes this system, while full of intricacies of it's own, does indeed make swapping out animations "simple" (and I tend to avoid that word). Mecanim itself is a complex beast so this asset doesn't do the impossible and make everything about bridging the gap between your vision and mecanim easy but it can drastically simplify your workflow and drops some pretty malleable tools in your lap. So with just a little learning time investment I'd say yes, you can SIMPLY swap some animations into some of the built in motions and have both humanoids and non humanoids both running around and attacking, blocking, dying, waking up, dance fighting or whatever in no time. Tim is a good guy and won't use the word simple, but I will. Genius stuff round here and excellent support to boot.

     
    Tryz and TeagansDad like this.
  13. francescobr

    francescobr

    Joined:
    Apr 2, 2017
    Posts:
    45
    @Tryz I can see what you mean, but as long as there are precise docs and a flow to follow I guess it's something I can work with. I read the docs about sword and shield pack and it looks like you make things in a certain structured way, that I like.
    I'm currently using invector asset, and I don't like many things of it, so I'm watching both opsive and yours.
    So if you don't mind I have some more questions for you :

    - does your controller manage stamina, with stamina refresh times and such?
    - can weak and strong attacks consume different values of stamina?
    - can we have combos using both weak and strong attacks, so something like RB, RB, RT (using xbox inputs as an example)?
    - does your lock system only work when there are targets in sight? I ask this cause invector's lock system requires you to push the lock button again after all targets are killed to exit lock mode.
    - is your component a complete project? cause I'd have to import it in an already existing project
    - are there any new major versions in your roadmap, that would require a big update in the following months (this is opsive's case, with a 2.0 version coming soon I don't wanna waste money on something that will be unsupported soon)?
    - how easy it is to add actions like opening a chest, opening a door, and such?
    - what packages are strictly required to implement a dark souls melee and magic combat system?
    - does your assets implement AI for enemies or do I have to use my own? If it does, how hard is it to swap it in favor of another one? If it does not is there any particular asset you advice to use?
    - I see you rely a lot on sending messages, isn't that heavier performance wise?

    I know it's a lot of questions, but I read your refund policy, so better safe than sorry! Thank you :)

    Thanks for your post, I can understand why he doesn't want to say "it's simple".
     
    Last edited: Jan 23, 2018
  14. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    hahaha... Thanks @christougher
     
  15. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    My motions themselves don't know anything about stamina. You would implement that using Reactors and my Basic Attributes. Reactors allow you to handle messages like "pre-attack", "damaged", and post-attack". This way you can modify things like attack style and attributes as needed.

    I provide the pieces and basic game-play. You connect the pieces for your unique game.

    Yes. If the enemy dies the lock goes away.

    No. My assets are components you bring into existing projects.

    No major revision, but I am constantly doing updates and providing new features.

    There's an interaction motion you can use and a demo scene. This video may help:


    All of my packs could be implemented by you. So, none of them are "required". However, if you want to save some time, my packs are a good option. Which ones depend on the features you want. The only non-obvious thing that I need to fix is that the "Sword & Shield Motion Pack" is really a "Melee Combat Motion Pack". I just provide the sword and shield as a base. The "system" works for any melee combat.

    I provide some basic code-based AI you can check out. I've also got several videos that may help.



    On the Vault (where others and I provide free stuff), you'll find integration with Node Canvas and Behavior Designer.

    Not really. The biggest hit would be message instantiation, but I pool them.

    Of course there is some overhead, but that's the price we pay for flexibility. Messages have proven to be the best way to allow disconnected systems to communicate. This way, you can customize and control game play without having to modify my code.

    Not a problem. :)
     
  16. francescobr

    francescobr

    Joined:
    Apr 2, 2017
    Posts:
    45
    It all looks so well done that my finger is already on the add to cart button.
    One last question since I saw the camera controller, bone controller and mount points packages and I have some doubts on those :

    - camera controller : does this expand on the cameras you already have on motion controller to cover more special/advanced needs? Have I got that right?

    - bone controller : can this work on already existing animations or does it need specific animations? I'm not that versed on IK, but I believe you already have basic IKs working on motion controller and this is something more specific?

    - mount points : is this needed to change weapons and clothes? or is it just a commodity? do you think it might give me some advantages in the beginning or I can swap equipment even without it?

    Thanks again.
     
  17. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    The camera rigs I include totally work, but are pretty basic. One is a simple 'fixed' camera rig and the other allows for orbiting.

    The Camera Controller is much more advanced as it support different motors, transitions, view obstruction, FOV zoom, etc.

    It will work with any animation. I do include some minor IK in some motions, but for foot placement, looking, etc. the BC would handle that.

    If you've got lots of different characters and weapons, MP can save a bunch of time. To me, the big thing is swapping out skinned meshes (ie shirts, pants, etc). That gets a lot trickier than just putting something on a transform.


    My suggestion is that you get the MC and play with it. If the included cameras and IK work for you, than you're good. When/if you get to the point that you think you want the more advanced features that these assets offer, then get them.

    One thing I think everyone would tell you is that I try to be very modular. This way you can use my included cameras, use the Camera Controller, or even use someone else's camera solution. All my assets are very 'component' based.
     
    francescobr likes this.
  18. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957
    Kubold's Sword & Shield animations swap in pretty easily, except for the shield. He's got the raise and lower shield animations as additive poses, so they need to run on an Animator layer masked to the upper body and set to Additive blending mode. His example controller (included with the animations) uses a float Animator parameter in a blend tree between the raise shield, centered pose, and lower shield animations.

    However, I came up with a solution months ago and I have it working pretty well, so I can share that if you go this route.

    If you're not using another 3rd party system (such as ORK Framework) to manage health, stamina, etc, then you'd just need to write a fairly simple component that manages the refresh rates of these attributes. I'll probably create one at some point in the near future.

    You probably need a customized motion which inherits from BasicMeleeAttack to handle weak and strong attacks using multiple input values. I don't think it would be terribly complicated, as most of the complexity is going to be in the base motion. You could have this motion set stamina consumption, or you could also use a Reactor that runs in response to an attack being initiated.

    My recommendations are:
    • Motion Controller (obviously)
    • Camera Controller
    • Archery Motion Pack
    • Sword & Shield Motion Pack
    • Spellcasting Motion Pack
    The cameras included with MC are functional but are going to be too basic for most games. They don't handle collision, for example. The Camera Controller also makes it easy to swap between different camera states. The way I see it, $35 of my time wouldn't even cover me researching how to extend the basic camera to handle collisions. :)

    The Spellcasting Motion Pack comes with a node-based spell editor, which is very nice, and I've also used it for building creature special attack as well. Sword & Shield MP is really the foundation for melee combat and is easily extended to any melee weapon, creature melee attacks, etc.

    This depends on what else you're using in your project. Inventory Pro or ORK Framework, for example, have their own subsystems for attaching a weapon to a character's hand. They both also have their own methods of attaching skinned meshes to the character, but Mount Points does that much better.

    If you're using UMA, then it has its own method of handling adding any skinned meshes to the character (which is actually what UMA is at its core; the character models supplied with it are examples).

    I ended up writing my own simplified "mount" system, as I was using UMA and at the time you could not use Mount Points with it (the upcoming release of UMA 2.7 includes a Bone Builder tool which allows you to create the skeleton at design time).
     
    BackwoodsGaming, francescobr and Tryz like this.
  19. francescobr

    francescobr

    Joined:
    Apr 2, 2017
    Posts:
    45
    Thanks to you both!
     
    Tryz likes this.
  20. antoripa

    antoripa

    Joined:
    Oct 19, 2015
    Posts:
    1,163
    @Tryz I have added CC to MC. I would that camera rotate with mouse without pressing the button. I am not getting what is the setting for that.. can you kindly help me ?
     
  21. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    On the Input Source that's in the scene, change the "View Activator" to "None".

    I put it here since other components also care if the view is changing.
     
    antoripa likes this.
  22. MaliceA4Thought

    MaliceA4Thought

    Joined:
    Feb 25, 2011
    Posts:
    406
    Thanks :) Good to go now to next :)

    M
     
    Tryz likes this.
  23. rubble1

    rubble1

    Joined:
    Apr 25, 2010
    Posts:
    84
    Hi Tim, I was curious is you or anyone could give me some pointers as to what I'd need to do to get to get the sword and shield pack working in multiplayer.

    I've got him able to walk around, but I want to know how to damage/kill the other player.

    I'm using Photon PUN, and doing some tests in the Unity editor, I can actually see the other instantiated player's health being depleted, but there's no reaction to it (doesn't play the damaged animation).
    The remote/online player can't seem to damage the local player.
    I have Photon observing the Transform, Animator and Basic Attributes components, and also the character's weapon transform).

    Another related thing I'm curious about is the Inventory system. Right now, if I have photon observe it or not, when I draw the sword, it makes the opponent (the remote player) draw the sword as well, but only in the local view.
    How do I separate them?

    I noticed in the sword and shield demo, there's an event system. What is that for? Does that have anything to do with any of this, or is that for the targeting?
     
    Last edited: Jan 24, 2018
  24. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Hey @rubble1 , Unfortunately networked multiplayer is probably the part of game development I know the least about. So, I don't have a whole lot of advice on transferring stats across the network.

    From what I've read, things like damage and even death are managed on the server. Typically this is so clients can't cheat and send fake info to the other clients. This also allows for one "master" so you don't have one client saying the health is 100 and another saying it's 50. I believe this is called an "authoritative server".

    I'm not sure how you're handling the network or server aspect, but I'd imagine you'd do one of two things:

    1. In the case of an authoritative server you would capture that a swing occurred and maybe even a hit and send that to the server. The server would determine the result (miss, damage, kill, etc) and distribute that to the other clients who would play the animations and maybe update stats like health.

    2. Without an authoritative server, I think you let the player's local determine if there is a hit and the result. Then, you'd send that directly to the other clients and the remotes play the animations.

    What it seems like is that the "remote" version of the characters tend to be dumb (ie no Motion Controller or AI). They are just playing the animations and setting the position that the server told them to do.

    I think this goes for creating an instance of a sword across the network too. The server is the one that tells all the clients there's a new sword instance and what it's attached to.

    Again, I'm just going off of what I've read and not something I've done myself.


    The event and messaging flow is to help you customize your game-play without having to modify my assets. For example, if you react to an OnDamaged event, you could have a barrel explode or a character take damage. As far as networking, you could use it to send information to the server as well. So, I think it could help.

    Sorry, I wish I had more specifics on the networking stuff. It's just not something I really know about.
     
    rubble1 likes this.
  25. MaliceA4Thought

    MaliceA4Thought

    Joined:
    Feb 25, 2011
    Posts:
    406
    OK next :)

    I would like to have the character (lets say with sword and shield) mount the items on the character when not in use so they don't appear from the "nuance of vapour" :)

    I see in the equip scripts in the create function that these are equipped from the inventory.

    Would the logical step be to have these attatched to the character in the rest positions and then just set them to inactive when the create item is called at the same time as the equip command is thrown?

    Alternatively, thinking to the future with multiple weapons available, would it make more sense to have "at-rest" items in the inventory as new locations and un-equip the "at-rest" items when you equip the active weapons? (I think, though more complex, this would be a better way)

    And has anyone else done this and got examples or suggestions or other ways of doing this ?

    M
     
  26. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    You can actually do this now.

    Just place the sword (or any item) on the character where you want it to be stored.


    In the Basic Inventory, in the "Items", there's an "Instance" property. Drag the item into that property.



    Now when you equip the item I'll grab it from the instance. When you store it, I'll put it back where you originally placed it.
     
  27. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957
    @moria15 - You can already do this with BasicInventory. If you attach the weapons to the character model in their "stored" locations at design time, you can drag those objects into the Instance field on each item in BasicInventory. As long as those items are there when it initializes, then it should work.

    This doesn't really help us in an actual game situation where we have a more robust inventory. But it's good for a demo.

    I've written my own extensions to BasicInventory that integrates with Inventory Pro and ORK Framework. In simplified terms, I tap into whatever the 3rd party inventory uses to notify that an item is equipped, and then I dynamically create the BasicInventory Items and Sets.

    Then I use a simple custom mount system to swap between equipped and stored locations.
     
  28. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957
    BackwoodsGaming and Tryz like this.
  29. MaliceA4Thought

    MaliceA4Thought

    Joined:
    Feb 25, 2011
    Posts:
    406
    Well thank you both, that was damn easy :)

    Sheesh, I will get used to this :)

    @TeagansDad hmmmmm sounds like you might be getting a load more questions from me when I get to doing a full inventory system, but 1 set of weapons is fine for at least the next 10 minutes :)

    Regards
    M
     
    TeagansDad and Tryz like this.
  30. zeb33

    zeb33

    Joined:
    Nov 17, 2014
    Posts:
    95
    Hi
    Has anyone got MC working withh easytouch? Im using the Easy Touch 5 Input Source from the vault but am having issues equipping the bow. The touch button calls BasicInventory.EquipWeaponSet , but this causes the character to ping pong between equipping and unequipping in a continuous loop. Any ideas?
     
  31. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    I haven't used Easy Touch, but it sounds like you might be calling BI.EquipWeaponSet() with an "IsPressed" and not an "IsJustPressed".

    "IsPressed" occurs every frame a button is pressed. So, lets say it's pressed for 0.25 seconds, that's 15 frames (60 FPS x 0.25). That's 15 calls to BI.EquipWeaponSet().

    "IsJustPressed" only occurs on the frame when the button wasn't pressed last frame, but it is pressed this frame. So, it happens only once.

    Any chance the Easy Touch 5 implementation isn't respecting that distinction?
     
  32. zeb33

    zeb33

    Joined:
    Nov 17, 2014
    Posts:
    95
    Hmm, not sure.
    If I return false from the IsPressed method of the input source it still loops. Calling equipweaponset from OnUp() does the same.
    Also, just discovered the looping does end eventually after a few minutes.
     
  33. ramoida

    ramoida

    Joined:
    Jan 3, 2017
    Posts:
    5
    Hello everyone! This my first time here!

    I've been messing with the MC and Photon PUN in the last few days. I've read many people here has experience with Photon and MC and you might be able to help me.

    I really wanted to post a video on how I did my set up and ask for advice on how to fix some issues that I am having.
    The video is a bit long (my bad :( ) however, it first shows the bugs I encountered and then it shows how I did my set up, so it will also work as a starting point for anybody interested in doing these sort of things. Gotta contribute too!

    I did the setup in about 1 hour, but is taking days/forever to solve the issues I'm having. So any help will do!
    The main issues are:

    1 Network issues:
    • Animations don't work if I don't delay the MC so the networks can read and store the LXMotionPhase changes.
    • If I delay, then Jumping or any similar motion that requires fast resets of the LXMotionPhase to 0, will re-enter and glitch.
    • But the overall question is: why do we need to depend on a delay to get this working?
    • Final issue is Grounding problem in updated clients. Other players are landing half body underground (SOLVED - See Edit 2)
    2 Motion controller issue:
    • MC climbing issue with thin walls. (This one is for @Tryz :) )
    Thank you so much for your time in advance, and hopefully we all can get this working, once fixed i'd love to make a video with a full tutorial!

    Video:


    Edit 1:
    Added a new brief video clarifying Animations problem:


    Edit 2:
    This settings seems to fix the grounding problem
     
    Last edited: Jan 27, 2018
    Tryz and rubble1 like this.
  34. Salja

    Salja

    Joined:
    Mar 23, 2017
    Posts:
    353
    Tryz, rubble1 and christougher like this.
  35. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Hey all. In bed sick this weekend. Give me a day or two and I'll catch up. Sorry for the delay.
     
    hopeful and ramoida like this.
  36. MaliceA4Thought

    MaliceA4Thought

    Joined:
    Feb 25, 2011
    Posts:
    406
    Get better soon :)
    M
     
    hopeful likes this.
  37. rubble1

    rubble1

    Joined:
    Apr 25, 2010
    Posts:
    84
    Hi ramoida,

    Thank you for sharing your findings. I tried what you're saying in the video, and like I told you in my message, I hadn't really been using the jump all that much in my demo, so I went ahead and put it in to try it out.
    For mine though, when the character was falling, he didn't go through the ground, so I didn't bother putting the Photon Transform on. Just FYI, but perhaps I'm not doing something the way you did.
    I'm no expert, but perhaps could it be the motion/priority or order on your character's settings?
    I'll give it another try later to make sure I'm on the same page as you.
    If I do run into this, I'm very glad you found this workaround though.

    The info on the Animator Clear is really helpful too, It's nice to know how to access it. On my quick test I did this afternoon, I was still getting a bit of stuttering with it, but I'll have to play with it some more.

    Actually Tim, this is a lot of help, Thank you. The reactor functionality is really great.

    My current setup is more or less like this:
    I've got a "Network Manager" object, unique to every player handling things like instantiation. This brings in in the character with the motion controller, sets up cameras, turns on/off components I don't need for the remotes or locals. So far, so good.

    Based on your suggestions, my idea is to put functions on that object (which will be observed on the network through a PhotonView script) that will fire off the motions, or send a message to damage the character.

    Through the reactors I'm able to call these functions. But how do I do this the other way around?
    I'm sorry if this is a silly question, how do I call up a reactor from that script? I mean how would I send a message to have the character activate the Damaged Reactor for example?

    That damaged reactor is responsible for determining that the character's been hit, and passing the info on to the attributes, correct?
     
    Last edited: Jan 28, 2018
    Tryz likes this.
  38. francescobr

    francescobr

    Joined:
    Apr 2, 2017
    Posts:
    45
    Sorry to hear that. While you are in bed I'll ask you some questions about climbing obstacles and ladders :
    I've been able to setup a ladder and have my character climb it, but the same ladder does not work when duplicated and moved on another point of the same scene. My character seems to mistake it for a regular obstacles and climbs like the first step, passing through it landing on the other side of the ladder. I even tried adding colliders for each step.
    It also looks like only regular ladders can be used, since I have one that's a bit awry, and that cannot be climbed. Even the first ladder if rotated cannot be climbed.
    So I tried setting up ladders and things I want to be climbed on 2 different layers, climbables and ladders. But doing so at first I got no collisions, since the player only collides with default layer. Adding climbables and ladders to the colliding layers then left my character unable to climb on them.
    So, what am I doing wrong?

    I tought it could be something related to my character setup, and I adjusted the feet sphere to be more aligned with feets (it was a bit over the feet, so it did not touch the ground) but with no succes.
    Also how do I know how tall my character is?

    One other thing : I was able to add interactions, a door, a chest, now I added a chair. Player has to stay on chair until a button is pressed, so I added a form 3 to the animator in the BasicInteraction-SM with my animation. Everything works, but since there is no exit time (I want him to stay sit, not just sit and stand up immediately after) it looks like the Interactable Core of the chair does not fire events. I also tried firing an OnAnimationEvent event, but also that does not seem to fire. I don't know if that may be cause the animation is just 1 second long, I got an import message telling me the event was outside the animation range, so I decreased that, and tried to made it fire as soon as the animation starts, and the import message disappeared, but still it does not work. I tried removing exit time from an animation in the demo scene, and there I get the desired result. How could I debug this situation? EDIT : I was able to have events firing by setting exit time to 1 and transition duration to 0. I don't know why this fixed it.
    BTW : has anyone got good resources to read for animations noobs like me?

    Another question about interactables : Interactable Core has a "Interaction motion" parameter, that says "Motion that we'll use to interact with". Did I understand something wrong or has that to always be a BasicInteraction motion? Does that also mean that I had no choice but to add my animation under the BasicInteraction-SM state?
     
    Last edited: Jan 30, 2018
  39. rubble1

    rubble1

    Joined:
    Apr 25, 2010
    Posts:
    84
    Nevermind, I see now. Of course, the motion itself fires off the reactor.

    You get better. I hear that flu going around is pretty bad.
     
    Tryz likes this.
  40. MaliceA4Thought

    MaliceA4Thought

    Joined:
    Feb 25, 2011
    Posts:
    406
    Hello all :)

    OK am trying a little experiment.. I have been using Morph3d chars, but it's such a pain.. anyhoo.. I saw a video for integrating inventory pro (which I use) with UMA characters. Soooo I got that working with UMA 2.7 in a test project.. so I can finally swap clothes etc with Inv pro.. however.. now I can't get ootii to work with UMA where UMA is 2.7.

    I tried looking at the vault at the integrations, but I think a fair amount has changed between 2.5 and 2.7

    Was wondering if anyone has some tips here :)

    Regards

    M
     
  41. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957
    What problem are you having getting it to work with UMA? I had it working fine with UMA pretty recently... it was using a snapshot of UMA 2.7 from a few weeks ago; I haven't grabbed the most recent code from the GitHub yet.

    I don't think the basic stuff has changed tremendously though.
     
  42. MaliceA4Thought

    MaliceA4Thought

    Joined:
    Feb 25, 2011
    Posts:
    406
    HI :) OK I followed the integration instructions as closely as I could (I think I got the right bits) and got a UMA DCS char to work pretty much OK this time:) (so I'm stupid) since the demos don't match in the latest MC so I had to use the ybot as the base char. My base is UMA 2.7 beta and Latest MC.

    but I do still have a couple of issues...

    1) I got a console error ( didn't stop things working) when it's running of :-

    Destroying assets is not permitted to avoid data loss.
    If you really want to remove an asset use DestroyImmediate (theObject, true);
    UnityEngine.Object:Destroy(Object)
    UMA.UMAUtils:DestroySceneObject(Object) (at Assets/UMA/Core/StandardAssets/UMA/Scripts/UMAUtils.cs:89)
    UMA.UMAGeneratorBase:UpdateAvatar(UMAData) (at Assets/UMA/Core/StandardAssets/UMA/Scripts/UMAGeneratorBase.cs:175)
    UMA.UMAGeneratorBuiltin:UpdateUMABody(UMAData) (at Assets/UMA/Core/StandardAssets/UMA/Scripts/UMAGeneratorBuiltin.cs:336)
    UMA.UMAGeneratorBuiltin:HandleDirtyUpdate(UMAData) (at Assets/UMA/Core/StandardAssets/UMA/Scripts/UMAGeneratorBuiltin.cs:242)
    UMA.UMAGeneratorBuiltin:OnDirtyUpdate() (at Assets/UMA/Core/StandardAssets/UMA/Scripts/UMAGeneratorBuiltin.cs:265)
    UMA.UMAGeneratorBuiltin:Work() (at Assets/UMA/Core/StandardAssets/UMA/Scripts/UMAGeneratorBuiltin.cs:132)
    UMA.UMAGeneratorBuiltin:Update() (at Assets/UMA/Core/StandardAssets/UMA/Scripts/UMAGeneratorBuiltin.cs:97)

    I cured that by using the Bone Builder.

    now I just have 2 console warnings... lots of the first one... a few of the second. (but it's working)

    ootii.JSONSerializer.DeserializeValue - Transform name 'mixamorig:Hips/mixamorig:Spine/mixamorig:Spine1/mixamorig:Spine2/mixamorig:Neck/mixamorig:Head' not found, resulting in null
    UnityEngine.Debug:LogWarning(Object)
    com.ootii.Data.Serializers.JSONSerializer:DeserializeValue(Type, JSONNode) (at Assets/ootii/Framework_v1/Code/Data/Serializers/JSONSerializer.cs:661)
    com.ootii.Data.Serializers.JSONSerializer:Deserialize(String) (at Assets/ootii/Framework_v1/Code/Data/Serializers/JSONSerializer.cs:300)
    com.ootii.Actors.Attributes.BasicAttributes:OnAfterDeserialize() (at Assets/ootii/Framework_v1/Code/Actors/Attributes/BasicAttributes/BasicAttributes.cs:365)
    com.ootii.Actors.Attributes.BasicAttributes:Awake() (at Assets/ootii/Framework_v1/Code/Actors/Attributes/BasicAttributes/BasicAttributes.cs:71)
    BasicAttributesEditor:OnEnable() (at Assets/ootii/Framework_v1/Code/Actors/Attributes/BasicAttributes/Editor/BasicAttributesEditor.cs:35)

    Exception in UMAGeneratorBuiltin.OnDirtyUpdate: System.ArgumentException: failed to convert parameters
    at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0005d] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:484
    at System.Reflection.MonoCMethod.Invoke (BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:528
    at System.Reflection.ConstructorInfo.Invoke (System.Object[] parameters) [0x0000e] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/ConstructorInfo.cs:77
    at UnityEngine.Events.PersistentCall.GetObjectCall (UnityEngine.Object target, System.Reflection.MethodInfo method, UnityEngine.Events.ArgumentCache arguments) [0x000bf] in C:\buildslave\unity\build\Runtime\Export\UnityEvent.cs:469
    at UnityEngine.Events.PersistentCall.GetRuntimeCall (UnityEngine.Events.UnityEventBase theEvent) [0x00099] in C:\buildslave\unity\build\Runtime\Export\UnityEvent.cs:436
    at UnityEngine.Events.PersistentCallGroup.Initialize (UnityEngine.Events.InvokableCallList invokableList, UnityEngine.Events.UnityEventBase unityEventBase) [0x0002e] in C:\buildslave\unity\build\Runtime\Export\UnityEvent.cs:609
    at UnityEngine.Events.UnityEventBase.RebuildPersistentCallsIfNeeded () [0x0001a] in C:\buildslave\unity\build\Runtime\Export\UnityEvent.cs:775
    at UnityEngine.Events.UnityEventBase.PrepareInvoke () [0x00002] in C:\buildslave\unity\build\Runtime\Export\UnityEvent.cs:811
    at UnityEngine.Events.UnityEvent`1[T0].Invoke (.T0 arg0) [0x00002] in C:\buildslave\unity\build\Runtime\Export\UnityEvent_1.cs:53
    at UMA.UMAData.FireUpdatedEvent (Boolean cancelled) [0x00053] in E:\Unity Projects\uma-ootii\Assets\UMA\Core\StandardAssets\UMA\Scripts\UMAData.cs:1053
    at UMA.UMAGeneratorBuiltin.UMAReady () [0x00024] in E:\Unity Projects\uma-ootii\Assets\UMA\Core\StandardAssets\UMA\Scripts\UMAGeneratorBuiltin.cs:317
    at UMA.UMAGeneratorBuiltin.HandleDirtyUpdate (UMA.UMAData data) [0x00245] in E:\Unity Projects\uma-ootii\Assets\UMA\Core\StandardAssets\UMA\Scripts\UMAGeneratorBuiltin.cs:251
    at UMA.UMAGeneratorBuiltin.OnDirtyUpdate () [0x0005c] in E:\Unity Projects\uma-ootii\Assets\UMA\Core\StandardAssets\UMA\Scripts\UMAGeneratorBuiltin.cs:265
    UnityEngine.Debug:LogWarning(Object)
    UMA.UMAGeneratorBuiltin:OnDirtyUpdate() (at Assets/UMA/Core/StandardAssets/UMA/Scripts/UMAGeneratorBuiltin.cs:274)
    UMA.UMAGeneratorBuiltin:Work() (at Assets/UMA/Core/StandardAssets/UMA/Scripts/UMAGeneratorBuiltin.cs:132)
    UMA.UMAGeneratorBuiltin:Update() (at Assets/UMA/Core/StandardAssets/UMA/Scripts/UMAGeneratorBuiltin.cs:97)


    2) whilst not as obvious as the male char.. the Female char has rather wideapart legs when Idle, running or walking whereas the Default UMA DCS female on idle seems much more realistic.

    M
     
  43. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    I think I'm on my way back to the land of the living. Tomorrow I'll catch back up and respond to the posts.

    Thanks for being patient and thanks to all those helping others. It really is cool to know that people are willing to help! :D
     
    AlenH and MaliceA4Thought like this.
  44. kenamis

    kenamis

    Joined:
    Feb 5, 2015
    Posts:
    387
    @moria15
    For integrating with motion controller, there's not much different between uma 2.5 and 2.7. You should be using the script for uma integration from the vault. Double check you're using the right animation controller, you'll need to set it in the DynamicCharacterAvatar component under "Race Animation Controllers"

    For #2, that is a regular unity issue, you need to configure the mecanim avatar pose to be closer to your source animation pose. The part specific to UMA is to extract the T Pose into an asset and assign it to it's RaceData asset.
    http://www.umawiki.secretanorak.com/TPose
    There's a new included T Pose asset called "Male_Unified_TPose_Mecanim" (and female) that was updated by a community member. It's not set by default, but you can swap it out with the default T Pose asset on the male and female RaceData respectively.

    Feel free to PM if you still have issues with using UMA and ootii together.
     
    Tryz, hopeful and MaliceA4Thought like this.
  45. MaliceA4Thought

    MaliceA4Thought

    Joined:
    Feb 25, 2011
    Posts:
    406
    Hey Tim, hope you are feeling better.. If it's that flu thing, then yeah, been there got the T-shirt and slowly recovered.

    Here is todays really silly question.. Using 2017.3, I have got a UMA 2.7 character working fine with ootii including the Sword and shield pack using the vault instructions and not being stupid this time.

    In the editor, the char is fine.. walks.. runs.. jumps.. equips sword and shield and does combat. When I build the project.. everything is fine except the jump and running jump.. both are completely wrong.. the char does a little hop rather than a jump in both cases.

    Any ideas?

    Regards

    M
     
  46. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,676
    Congrats on getting UMA and MC to work together. At one point that was a difficult procedure, but it's not that bad anymore. :)
     
    Tryz and MaliceA4Thought like this.
  47. MaliceA4Thought

    MaliceA4Thought

    Joined:
    Feb 25, 2011
    Posts:
    406
    LOL yeah.. when we remove the (me being stupid) component.. it was fine... next step.. Inventory Pro based on Secret Anorak's implementation :)

    Then it's going to be all about the weapon swapping and other chaotic things like choosing where to keep things like stats etc and AI :).

    But I am getting there.. I am still amazed how all these packages are so good at overriding my own inability to do stuff and get a result :)

    M
     
    Tryz likes this.
  48. MaliceA4Thought

    MaliceA4Thought

    Joined:
    Feb 25, 2011
    Posts:
    406
    okay just a thought here, but I wonder if I could re-rig the animations with UMotion.. I have a copy but haven't used it yet.. that way I could tailor the anim and the limb settings (I think) to look more natural and then they would be a set of standard modified mixamo anims for all my UMA chars.

    In addition, I could make things like idle do more than just stand there doing zip.. the char could be looking around and have some life as well.

    I could also add new anims that way as well.

    May try this later today and see if I can learn UMotion as well and see how it integrates into MC.

    EDIT hmmmmm could Bone Controller do this as well?

    M
     
    Last edited: Jan 30, 2018
  49. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957
    Seriously, don't sweat the console warnings. They're just that, "warnings."

    You've got a reference to a transform on the Y-bot's rig (mixamorig:head) in one of your components. It looks like it's in Basic Attributes, which is weird, but check to see if you have an attribute set to that value. The other spots where components generally reference the Mixamo rig is in the Body Shapes section of Actor Controller, and the Combatant Transform on the Combatant.

    I wrote the UMA integration scripts that are up on the Motion Vault... I don't think I've needed to change them since I sent them to Tim.

    I think it would be way, way easier to just adjust the TPose on your avatars to better match the animations. :)

    You can also do this by layering animations, rather than making full body idles just to have a character looking around.

    You can set up a LookAt motor to have the character look at a particular object or in a particular direction. To have the character just quickly looking around while idling, you'll probably get a better result by playing an animation on the upper body.
     
    Tryz and MaliceA4Thought like this.
  50. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,676
    @moria15 - FWIW, I agree with all of @TeagansDad's suggestions. What I would add is for you to just go ahead in development without focusing too much on your animation details till you are near the end of your project. Until then, don't worry about over-broad character stances, hands clipping through hips when walking, and so on. That's because you may decide to use different animations or base models by the time you're done, and have to another round or so of tweaking, so don't sweat about it up front.

    However, when you do finally get to where the game is solid and everything is ready for tweaking, start with adjusting the T-pose, because that's at the top of the chain and will affect everything else. Then, if you are using animations from multiple sources, you may find you need to create new animations or modify others so that they fit and blend smoothly.

    BC is mainly IK for things like grounding, LookAt, tail sway, and targeted hit reactions. IK is stuff that makes minor adjustments to your character bones directly after each frame of animation, so that if you have a finger point animation, the IK will make the finger point at the target, instead of just pointing straight ahead, like the animation does. (I hope that makes sense. If not, read up on it, as it is a technique you'll want to use.)
     
    Tryz, MaliceA4Thought and TeagansDad like this.