Search Unity

Motion Controller

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

  1. StayUpLate

    StayUpLate

    Joined:
    Jul 29, 2018
    Posts:
    59
    I like it a lot! Is it doable to crate a camera path? As in; a curve which it follows? Some time ago I bought Adam's Pegasus system which has a very cool way of creating a path. You think this would be compatible with Slate?
     
    Salja likes this.
  2. StayUpLate

    StayUpLate

    Joined:
    Jul 29, 2018
    Posts:
    59
    Those are the Morph3D ones right? They are all humanoid rigged and should work. How do you have the characters animator component configured? You sure it's the right avatar?

    Edit: Oh and maybe also make sure the animator component comes before the MC. It shouldn't really matter, but Unity has an order of execution so it's prob. best to have the animator component before the things that use it (such as the MC).

    But it's always good idea to quickly read though the link b/c it can be a bit confusing
     
    Last edited: Sep 25, 2018
  3. Salja

    Salja

    Joined:
    Mar 23, 2017
    Posts:
    353
    Hey is not compatible, and it´s not need you can create camera flows with curves and keyframes inside of slate, is really easy and brings a smooth nice effect.

    If you come sometime into discord i will show you over screenshare :D my english is not really good otherwise I would spend the whole day to create tutorials for the community :D
     
    Tryz likes this.
  4. StayUpLate

    StayUpLate

    Joined:
    Jul 29, 2018
    Posts:
    59
    Ok let's do that soon! You can just speak German and I'll try my best to follow. Should be ok. :D
     
  5. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    I'm definitely not seeing an issue in my tests, but maybe it has something to do with Cinemachine.

    I actually am doing it based on the Actor Controller. If you check out Utility_SelectPosition.cs at line 257, I do this:
    Code (CSharp):
    1. Vector3 lToPoint = lHitInfo.point - lOwner.position;
    That's the raycast hit point and the spell caster's position. So, it makes me think that there's something else going on... maybe Cinemachine is shooting the raycast?

    On the "Ground Selector" prefab that the "Select Position Core" uses, you could add a small component that checks the distance between the transform and the character and changes out the material or particle effect. You could even customize the whole Select Position Core if needed too.

    Using the prefabs as replacements, you have a ton of flexibility to customize.
     
  6. Ivalobon

    Ivalobon

    Joined:
    Feb 20, 2017
    Posts:
    17
    I just recently tried to get MC and Inventory Pro playing nice together and imported the integration in the vault http://www.ootii.com/UnityMotionVault.cshtml#InventoryPro. Followed the instructions but started getting a lot of null reference errors in attached scripts. Anyone get this working that can give me some pointers? As of now IP will equip the sword but MC does not.
     
  7. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    It looks like that error is coming from Inventory Pro:
    Assets/Devdog/InventoryPro/Scripts/Editor/InventoryEditorBase.cs Line:18

    I think the last version of IP that I tried was about 5 months ago. If they updated or changed it could be something new. I wish I had a better answer. :(
     
  8. Necka_

    Necka_

    Joined:
    Jan 22, 2018
    Posts:
    488
    Thank you for those answer, for the prefabs I already replaced the particles and ground selector and it's really neat :)

    So to come back to this ground selector issue.. it's really weird.
    Cinemachine is really only a Camera positionner, it moves the Main Camera around, that's all (I mean, it can do more than that but for our issue it's really not related at all)

    I did a test with just the Main Camera, a plane with the Blue grid material.
    And it's quite clear that there is an issue with the distance and/or the collider

    If I set distances to 1 - 20, I place my character in the center of a grid (the cross)

    upload_2018-9-26_1-2-38.png

    Here are the results for just left and right (the same is for up and down)

    upload_2018-9-26_0-57-21.png upload_2018-9-26_0-57-25.png

    You can see that the selector can go further away on the left.

    The result in game is that the selector moves in a very choppy way as it is blocked by this wrong distance calculation.

    Of course putting something in distance like 1 -100 is then fine but that creates an issue in my gameplay logic where I don't want the players to teleport 100 units away

    The min distance doesn't create an issue (it just forbid the selector to get close to the character which is ok)

    In this example it's just a simple main camera (not even following the character) set to full top-down (I normally have a different angle but that's for example)

    And where it got worse is in my actual game scene where I have a Terrain (not a plane mesh). I don't know why but the selector doesn't even show up on some part of my terrain. I suspect slopes to be an issue but could'n't find a setting to change that.

    I know that MC is 90% made for Third person control over the should/behind the character. You have little to no examples with Top-Down style. I am doing only that so I might see issues in day to day that you couldn't foresee.

    But let's be honest; I'm almost certain that this isn't on your plate and that I f**'ed up something somewhere..

    I'd be happy to send you maybe some video example and whatever settings you'd ask me to give you.

    If by any chance you have an alternative way of spawning/moving this ground selector, I'd be happy to try it out

    Thanks again as always for your support
     
  9. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    This is what I'm not understanding about what you're doing.

    The position selector shows because of the ray shot from the main camera and hitting the ground. Then, that position is compared to the character's position to get the distance. It doesn't matter if it's third-person or top-down.



    In your pictures, how can the camera be "simple main camera (not even following the character) set to full top-down" and centered above the character while the projection is off to the left or right?



    In looking at the code (SelectPositionCore.cs line 310), we're either using the Targeting Reticle component in the scene or using the mouse position. In both cases, I use Unity's "Camera.main" property. I can only guess that the "Camera.main" property in your scene isn't actually pointing to the camera you expect... hence you're getting odd results.

    To figure this out, I'd do the following:
    1. Find out what's being returned by Unity's "Camera.main".
    2. Shoot some kind of debug line from it to see where it's pointing.
     
  10. Necka_

    Necka_

    Joined:
    Jan 22, 2018
    Posts:
    488
    Hello Tim,

    Thank you for your advice.
    So I made a little clean scene with my camera system, a little bolt script (you know I can't really code ^^) that output in the console "Camera.Main" and Draw a Ray line (had to google this one. The line is super long because I had to multiply the direction otherwise it was too short; I hope that is correct)

    I made two simple tests, one as a regular third person view quite close to the character, and I don't really see any issue here and one where I just move back the camera and also change its angle



    In this clean scene the issue is even worse as I can't move the selector forward at all

    Also as a side note: in all the test scenes (and in my main project) I never ever had more than one camera in all my scenes. I just use one Main camera and that's it. and it's always tagged as MainCamera
     
  11. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    This video is good.

    Notice in the beginning (0:02 to 0:15) you're moving the mouse, but your camera isn't moving? If your camera doesn't move, the ray shot from the camera doesn't move, and the selector doesn't move.

    If you want to use the mouse for selection instead of the camera, check the "Use Mouse" option in the spell editor.



    With that, the selector isn't based on the camera (which isn't moving), but the mouse.

     
  12. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402


    Testing is done!

    This is a massive change to the structure of all my assets. To learn more about what's coming, head to Update 2.8.

    Included in this update is a cool new "ootii Character Wizard" from @TeagansDad . We'll release it as 'beta' and we're looking for feedback.

    I plan on doing the push this week, but wanted to give people time to ask questions.

    Note:
    While I'll be pushing this update for Unity 2017.4 and higher, I've confirmed that the code and demos still work for Unity 5.6 and higher.

    Note:
    Due to how Unity organizes Assembly Definition Files, we will have to delete the entire ootii folder from Unity and re-import each asset.
     
  13. Necka_

    Necka_

    Joined:
    Jan 22, 2018
    Posts:
    488
    upload_2018-9-26_15-56-54.png
    ????????????????????????

    (this is a weird post I know, but stil: ?????????)
     
  14. Necka_

    Necka_

    Joined:
    Jan 22, 2018
    Posts:
    488
    Ah S*** I forgot to mention that part... I did figure that out and Switched to "Use Mouse" what you see in my video is with this setting already.

    I figured out something:

    If I go top-down (doesn't matter but whatever) - I set my camera distance quite close: it indeed works. I move the camera further away: start to be weird and the cursor start to be blocked above my character but I can move it completely below (from a top down view, imagine). I move even further away: the selector is blocked, can't move it

    I'm really not good with that, but you told me there was a raycasting (maybe not with the mouse though...) and I thought maybe the ray lenght isn't long enough to "see" the ground anymore

    That really how it feels, the more the camera is away, the less it works

    I just made a very clear video of the problem I just spoke about:
     
    Last edited: Sep 26, 2018
    Tryz likes this.
  15. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957
    It sets up Archery, Sword & Shield, and Spellcasting on the character. Swimming too, if it's there.

    Each of the Motion Pack buttons only shows up if the pack is installed. The "Ultimate Fantasy Hero" only shows up if all three fantasy packs are there.

    Advanced Mode gives you more control about what to set up. This Basic Mode is designed to produce a fully playable character with as few decision points -- and as little user input -- as possible.
     
    Last edited: Sep 26, 2018
    FargleBargle, hoodoo and Tryz like this.
  16. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957
    Note that you can also right-click on a character model in the Project view and select "ootii Character Wizard" -- the window will open with the character model alrwaal assigned.
     
    Tryz likes this.
  17. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    The videos really helped. :)

    I am limiting the raycast from the camera by the same distance as from the caster to the selector. So, like you said, when the camera is close we're fine. The further away the camera gets, the more we hit the limits.

    Try this...

    Go into SelectPositionCore.cs and change the following lines to have a "* 5" multiplier with the _MaxDistance property.
    Lines: 331, 341, and 351.

    So, from this:
    Code (CSharp):
    1. int lHitCount = TargetingReticle.Instance.RaycastAll(out lHitInfos, _MinDistance, _MaxDistance, _Radius, _CollisionLayers, lOwner);
    to this:
    Code (CSharp):
    1. int lHitCount = TargetingReticle.Instance.RaycastAll(out lHitInfos, _MinDistance, _MaxDistance * 5f, _Radius, _CollisionLayers, lOwner);
    That worked for me and we didn't hit the limits.
     
  18. Necka_

    Necka_

    Joined:
    Jan 22, 2018
    Posts:
    488
    Awww :(

    Seeing this dual wielding icon I was so excited!
     
  19. Necka_

    Necka_

    Joined:
    Jan 22, 2018
    Posts:
    488
    And that fixed it!

    Yay :)

    Thank you so much for your support!
     
    Tryz likes this.
  20. hoodoo

    hoodoo

    Joined:
    Oct 19, 2012
    Posts:
    154
    This is awesome! I can't wait to get my hands on the new update. I have the archery pack, shooter pack and swimming pack and the wizard looks really well designed. It will save lots of time for sure. Thanks @Tryz and @TeagansDad and everyone else that worked on it!
     
    Tryz likes this.
  21. Necka_

    Necka_

    Joined:
    Jan 22, 2018
    Posts:
    488
    One last question (on the teleport topic)
    Is there any built-in way to block the selector from going through objects that aren't in the same layer the selector is allowed to?
    For example I have a terrain and rocks (statics, another layer than the terrain and with colliders) around that terrain. The selector finds out there is a terrain below those rocks and allow the teleport (which you can imagine, is a problem as the character is then stuck in a rock)
    I can imagine ways around with some scripting to block that I guess, but maybe there is already something existing to prevent that issue (one of my idea without scripting is to put like a sphere collider on the selector in a layer that collides with those objects)

    Edit: ok the collider on the selector doesn't seem to be a working idea. I guess it's overridden by the selector script
     
    Last edited: Sep 26, 2018
  22. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Unfortunately, no.

    It sounds like you would need the concept of 3 layers:
    1. Hoverable and selectable
    2. Hoverable, but not selectable
    3. Not hoverable and not selectable

    I only have functionality for #1 and #3. You'd have to override the script as you mention.
     
  23. StayUpLate

    StayUpLate

    Joined:
    Jul 29, 2018
    Posts:
    59
    Great work guys!
     
    Tryz likes this.
  24. ve110cet

    ve110cet

    Joined:
    Dec 11, 2017
    Posts:
    10
    Thanks for the quick reply! That's very helpful. I'll post an in-progress video once I have it working better :D
     
    Tryz likes this.
  25. Ivalobon

    Ivalobon

    Joined:
    Feb 20, 2017
    Posts:
    17
    I have everything reimported with no errors but still no luck getting it working. I've setup everything according to the guide and after I still got nothing I attached break points to the two main scripts and they're not even hit. The item will equip in inventory pro but not through the swords and shields.
     
  26. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    The InventoryProHandler.cs class implements Inventory Pro's ItemChildEquipmentHandler interface. So, its Equip() and UnEquip() functions would be called from Inventory Pro.

    If they aren't being called, then the Inventory Pro engine isn't trigger them. I believe page 4 in the docs is key for that.

    Unfortunately, I can only guess that a step was missed or something. I'm definitely not an Inventory Pro expert.
     
  27. HashimSyed

    HashimSyed

    Joined:
    Jan 10, 2018
    Posts:
    4
    i'm having this error when i import Archery motion pack to my unity, what should i do?

    Assets/ootii/Framework_v1/Code/Actors/LifeCores/ItemCore.cs(9,26): error CS0535: `com.ootii.Actors.LifeCores.ItemCore' does not implement interface member `com.ootii.Base.IBaseObject.GUID.get'
     
  28. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    This is a namespace issue.

    I'm using the class name "ItemCore" and it has a property called "GUID". However, in your project another asset is also using a class named "ItemCore" and it does not have a property called "GUID".

    The developer of that other class needs to use namespaces with their ItemCore class otherwise no one in the entire world can ever use the class name "ItemCore".

    When you find the other ItemCore class, please contact that developer and ask them to use namespaces like all good developers should. :)
     
    StayUpLate, AshyB and TeagansDad like this.
  29. StayUpLate

    StayUpLate

    Joined:
    Jul 29, 2018
    Posts:
    59
    Anyone have a good resource for clothes (meshes) which I can attach to my characters using Mount Points?
     
  30. Greentoad

    Greentoad

    Joined:
    May 5, 2017
    Posts:
    2
    Does anyone have experience integrating the Ork Framework with the Motion Controller and Motion Packs?
     
  31. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    I never found a good resource myself. I ended up making my own using Marvelous Designer and using some from Mixamo's Fuse.
     
    StayUpLate likes this.
  32. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    If you search on this forum, people do talk about using it. I haven't myself.
     
  33. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957
    Yes.

    I'm in the process of collecting and revising the various ORK integration scripts that I've written over the past couple of years. I'll share the set when I'm finished revising them.

    What specifically are you trying to get working?
     
    Tryz likes this.
  34. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402


    Before updating, PLEASE READ THIS!

    This update REQUIRES that you delete your 'Assets\ootii' folder and re-import the assets.

    Today I'm pushing up a massive update to all my assets. The primary goal is to support Unity's Assembly Definition Files, but there's some other cools stuff as well:

    1. Assembly Definition File support
    2. New character wizard
    3. Restructure folders so demo files are in one place (easy to remove)
    4. Smaller download size

    Please back-up your project before updating. :)

    As always, I'm here to help.
     
    Last edited: Sep 29, 2018
  35. Necka_

    Necka_

    Joined:
    Jan 22, 2018
    Posts:
    488
    Hi Tim,

    Congrats on the update and thanks to all the people who helped you with that

    Question: Will this update break other assets integration with MC?
     
    Tryz likes this.
  36. Greentoad

    Greentoad

    Joined:
    May 5, 2017
    Posts:
    2
    I would like real time combat for an action-adventure style game. I don't actually have Ork yet. I was about to pull the trigger and buy it, but thought maybe I should ask around about it to find out how difficult or if it's even possible to integrate. It might not even be the best option for the style of game I'm aiming for.
     
  37. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Thanks. :)

    I didn't test all the integrations on the Vault, but I did test the Node Canvas one and after putting in my Proto character, it worked fine.

    We shouldn't have an issue since the namespaces and classes haven't changed.
     
    Necka_ likes this.
  38. Salja

    Salja

    Joined:
    Mar 23, 2017
    Posts:
    353
    Update has work good, just 1 Custom Motion i have to update, all my integrations works fine
     
    Tryz likes this.
  39. StayUpLate

    StayUpLate

    Joined:
    Jul 29, 2018
    Posts:
    59
    I've been changing some .cs files in order to make Krypto's fx working nice, so I'm not sure what would be the best way to get the updates without losing my work. My thoughts are:

    1. create backup prior to doing anything
    2. make my folder a (local) git repo
    3. commit and push current version as v0.1

    >> and from here I'm not sure:

    4. delete Ootii folder OR rename it temporarily?
    5. update assets and import them
    OR
    cherry pick changes
    OR
    paste my custom code into the updated ootii files
    OR
    better way?

    In my day job we are obliged to NOT pull in vendor/plugin updates during software development so this is kinda new territory for me :D
     
  40. Salja

    Salja

    Joined:
    Mar 23, 2017
    Posts:
    353
    if you change original ootii files will be good if you create a .diff file of your changes and later you merge the diff and resolve the conficts maybe ? this is what i have did
     
  41. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957
    @StayUpLate - can you tell me which .cs files you updated? I can tell you if they are ones that were changed or not.

    The two biggest changes in the update are:

    1. Restructuring the Assets/ootii/ folder. Previously, everything followed the common convention of having an Editor folder under each "feature" script folder. We've moved all of the Editor code into a parallel folder structure. Otherwise, you end up needing to create an Assembly Definition File for every single Editor folder and you suddenly have 2 or 3 dozen DLLs being created, which is undesirable to say the least.

    2. Revising how custom types are serialized. All of the custom types were being serialized as being in Assembly-CSharp.dll (the default assembly in a Unity project), which meant that adding .asmdefs broke all existing serialization for custom types, as they now belong to a different assembly. This includes Motions, Camera Motors, Attributes, Reactors... basically everything that you add to an ootii component via a Reorderable List control in the inspector. The deserialization is also more robust now; if it can't resolve the custom type using the fully qualified assembly name, then it will try finding the type in all referenced assemblies.

    Actually, the Motion Pack Definition files for each Motion Pack are substantially revised too. They're functionally the same, but they make use of some common setup code that is also used by the Character Wizard, and I split up the setup code in each pack definition into discrete functions (ConfigureMotions, ConfigureAnimator, etc) so that the corresponding Character Wizard setup module for each pack could just call certain functions on the definition file.
     
    Tryz and StayUpLate like this.
  42. StayUpLate

    StayUpLate

    Joined:
    Jul 29, 2018
    Posts:
    59
    They were specific to the guncore I believe
     
  43. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957
    I think those files are untouched, other than moving folders.
     
    Tryz and StayUpLate like this.
  44. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Most files didn't change other than to be moved to different folders. The wizard files and some setup stuff (ie motion pack definitions) are the exception.

    I love WinMerge for comparing files and folders. You could point one to the old "Assets/ootii" folder and one to the new "Assets/ootii/Assets" folder and it should find them all.

    WinMerge is free too.
     
    StayUpLate and TeagansDad like this.
  45. StayUpLate

    StayUpLate

    Joined:
    Jul 29, 2018
    Posts:
    59
    Updated all! The only issue I'm having is that -for some reason- I cannot reference any namespaces in my guncore.cs. Intellisense cannot find them and if I type them either way, it says they are unknown.

    If I create a script in my assets folder I can reference them just fine but in the guncore.cs it seems the code does not want to know about other namespaces. Anyone have an idea?

    2018-09-30 16_10_16-TPMC Boilerplate A - Microsoft Visual Studio.png

    2018-09-30 16_11_02-TPMC Boilerplate A - Microsoft Visual Studio.png

    Edit: I do notice that there are separate ootii csprojects in my game root folder. A lot of other stuff is in a different csproject. This might just as well be the entire purpose :D But just to be complete in my findings:

    2018-09-30 16_17_30-TPMC Boilerplate A.png
     
    Last edited: Sep 30, 2018
    Tryz likes this.
  46. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    With Assembly Definition Files (ADF), Unity starts to segment code like we do with DLLs. In my code, there are 3 ADF:

    ootii = For all my run-time code
    ootii.Demos = For demo and it references "ootii"
    ootii.Editor = For editor stuff and it references "ootii"

    You can see those references in the ADF setup files. For example, here's ootii.Demos:


    You'll notice that "ootii" has no references; not to ootii.Demos, ootii.Editor, or EZCameraShake. That means code in my ootii assembly won't be able to reference things outside of it.

    Unless...

    1. You put your code (EZCameraShake) into an ADF and then have the ootii ADF reference that.

    2. Move your EZCameraShake into my ootii ADF folder structure.

    3. Remove my support for ADF by removing my three ADF files that are in the root of each folder.


    All that said...

    I actually don't think you should modify my GunCore.cs.

    Instead, I think you should inherit from it and put it outside of my ootii ADF. This way, it lives at the same level as your EZCameraShake class. Now, your StayUpLateGunCore.cs can inherit from GunCore and reference EZCameraShade as well as my code.

    Put your StayUpLateGunCore.cs on your guns and remove my raw GunCore.cs.

    It also keeps you from having to re-add your changes when I update my assets. :)

    I hope this all makes sense.
     
    Last edited: Sep 30, 2018
    StayUpLate and TeagansDad like this.
  47. StayUpLate

    StayUpLate

    Joined:
    Jul 29, 2018
    Posts:
    59
    Thanks Tim! Option 1 worked straight away. I realize it's best to stay out of vendor code, but for what I wanted to do I had to change 1 or 2 things up a bit. As I'm learning I'm sure I will find a better way to customize
     
    Tryz likes this.
  48. Weblox

    Weblox

    Joined:
    Apr 11, 2016
    Posts:
    277
    Hi @Tryz - So I'm trying to get the Mixamo Animations, but loading the packages on the Y-Bot, the Shop is not showing any animations names as in your video. Am I missing out on something?

    mixamo.PNG

    Also I am missing some buttons appearently and Mixamo Shop seems unresponsive and freezing on my end. Anything I can do ?

    Thanks in advance ... :p
     
    Last edited: Oct 2, 2018
  49. Salja

    Salja

    Joined:
    Mar 23, 2017
    Posts:
    353
    The Videos is before Mixamo change the Website, you can press Download Button and Download the Animations the freezing is normal i have same here, but he will download all animations without problems
     
    Tryz and Weblox like this.
  50. Weblox

    Weblox

    Joined:
    Apr 11, 2016
    Posts:
    277
    Thanks @Salja - I tried to do that and downloaded FBX for Unity on 60 FPS. The downloaded animations however don't seem to match the naming conventions in Ootii's Tuto ...

    mixamo_anims.PNG

    e.g. : sword and shield crouching (2) instead sword and shield crouching_2

    any advice, but manually renaming?