Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. Unity 2020 LTS & Unity 2021.1 have been released.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Motion Controller

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

  1. antsonthetree

    antsonthetree

    Joined:
    May 15, 2015
    Posts:
    95
    @KeithBrown Thanks that did help. Shift and F are now working in the demo scenes. However the _QuickStart scene is still not responsive.
     
  2. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,375
    @antsonthetree How are using using the "_QuickStart Start Demo Template" scene?

    You'll want to setup your character per the User Guide. For example, I did this:
    1. Started a new Unity 2020.2.2f1 project
    2. Imported the Motion Controller
    3. Opened "__Quick Start Demo Tutorial"
    4. Added my Proto character
    5. Added the Motion Controller
    6. Pressed "Setup Input Entries" on MC
    7. Pressed "Adventure Style" movement style on MC
    With that, I was able to walk, run, jump, etc.

    Pressing the "Adventure Style" sets up the:
    1. Input Source
    2. Camera Rig
    3. Actor Controller (basic settings)
    4. Motion Controller (basic settings)

    The _QuickStart scene is just an environment you can tweak to test different aspects of the Motion Controller and Motion Packs. Start with the specific demo scenes in "_Demos > Motion Controller > Scenes" as those show specific abilities.

    I hope that helps,
    Tim
     
    TeagansDad likes this.
  3. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    938
    Also, if you use the Character Builder, it will set up the camera controller and input source in the scene and ensure all necessary input aliases are created. I exclusively use the Character Builder and the _Quick Start scene whenever I'm working on anything, so I can vouch that it works. :)

    If you use the CB, then don't use the movement style buttons on the Basic view of the Motion Controller, or it will overwrite what the CB set up for you.

    I suspect that you were missing the required input entries.
     
    Tryz likes this.
  4. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,375
    @TeagansDad is the Character Builder guru! Listen to him. :)
     
    TeagansDad likes this.
  5. antsonthetree

    antsonthetree

    Joined:
    May 15, 2015
    Posts:
    95
    @Tryz Thanks guys. I assumed it was just a start and run scene like the others. I didn't realize it was more of a testing lab / setup thing. Appreciate the clarifications!
     
  6. antsonthetree

    antsonthetree

    Joined:
    May 15, 2015
    Posts:
    95
    I do have a follow up question: I notice in the demo scenes for MotionController that each of the PlayerBots has a Rigidbody attached. However it does not look like it is required or even used. I deleted it from a couple of the bots and the controller still works fine. Am I missing a step or why are they there? I'd prefer my characters to not have them (rigidbodies) if possible.
     
  7. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    938
    It's there so that they can interact with other rigidbodies (for example, knocking over objects). If you don't want that, then it's safe to remove.
     
    antsonthetree likes this.
  8. antsonthetree

    antsonthetree

    Joined:
    May 15, 2015
    Posts:
    95
    Hello - Thanks for your help so far. Now I have another issue that hopefully has an easy solution.

    I am trying to implement gravity on a very small planet. For now I'm using a standard sphere scaled to 30,30,30 along with the example player capsule and Actor Controller. Here are the steps I followed:

    1. I created a simple monobehavior that takes a normalized vector (GV) from the actor's position to the center of the sphere and in the FixedUpdate I set the AC.Gravity = -GV * 9.8. This worked except the actor did not orient with the gravity vector.

    2. In ActorController.cs I changed the alignment code at lines 2141 and 2147 to use mWorldup instead of Vector3.up. This fixed the alignment issue and now I can walk around my planet. Running and jumping. Yay.

    Here is where my problem happens. I built a small ramp on the planet surface with a cube, ran up it, and jumped off. When I land back on the planet I keep sliding forwards. Sometimes I even slide backwards. If there is another ramp in front of me after I land, I will usually slide up the ramp. I do have Sliding turned off in the AC settings. I suspect this is related to the accumulated velocity vectors but I haven't been able to find out exactly where the issue is.

    I unfortunately cannot use the Relative Gravity and Align to Surface options as this makes the actor align to the surface normal and not the gravity direction. My surface will not always be a regular sphere. Eventually it will have irregular shaped features and I want my actor to always be oriented with gravity regardless of the surface he is on.

    Hope someone can help. I can put together an example project if necessary.

    Thanks
    Jake
     
  9. Jayiel

    Jayiel

    Joined:
    Nov 1, 2018
    Posts:
    2
    We started working on getting in the ootii melee combat system and were also working separate from scratch on tree chopping as well as harvesting and mining. One of our programmers says we do not have to build them from scratch, as the ootii system can be used for chopping trees and rocks (aka mining) and harvesting food items with tools. They say the ottii system does not care what the player is doing as far as combat, harvesting gardening or trading items as long as we have the appropriate animations and tools / weapons and set it up correctly.

    Is this correct? Would we just set up each tree prefab or rock prefab similar to the NPC enemies (to take damage and die) and the payer use an ax, pick ax and hoe in place of a sword. If this is true, then we could also use the ootii system for non-combat interaction with NPCs. The player could then give an item to an NPC the same as using a weapon to do damage to an NPC. I did not see any videos on YouTube showing this concept of how to use it like this for non-combat tasks. If we can use the add-ons for more than combat we will also buy the oottii Shooter Motion Pack add-on for doing ranged healing in a Sci-Fi medic scene we will be working on next. (like a Star Trek Phaser only it heals instead of damaging)

    ALSO: We did get the swimming animations swapped out.
    We have it working perfectly in the Suimono Ocean and R.A.M. Lakes, but it will not swim in the R.A.M. River so we are removing the R.A.M. River and using a shallow GeNa Pro River the player can wade across.

    ootii items on our buy list:
    ootii Mounts
    ootii Shooter Motion Pack
    ootii Dispatcher
    ootii Easy Input
    ootii Debug Logger

    I am now interested in seeing just how much we can do with the ootii asset tools.
    We already have:
    ootii Third Person Motion Controller
    ootii Camera Controller
    ootii Swimming Motion Pack
    ootii Spell Casting Motion Pack
    ootii Archery Motion Pack
    ootii Sword & Shield Motion Pack
     
  10. KeithBrown

    KeithBrown

    Joined:
    Apr 1, 2017
    Posts:
    175
    @Jayiel Ootii's system will allow you to play any animation without writing any code.



    It will also allow you to write custom motions that will let you do anything that you want. You can use the included motions as guides to do what you want.



    There is also the motion builder's guide. https://ootii.com/wp-content/uploads/MCMotionBuilder.pdf

    If you place a component that implements IDamagable on any object, it will take damage from the ootii combat system. This post talks about it. https://forum.unity.com/threads/motion-controller.229900/page-121#post-3890944

    If you search for IDamageable in the Ootii codebase you can see how Ootii's components will get that component from a gameobject and call its interface members.
     
    Last edited: Feb 11, 2021
    LNMRae likes this.
  11. KeithBrown

    KeithBrown

    Joined:
    Apr 1, 2017
    Posts:
    175
    I was attempting to improve upon the sword core and add some functionality by adding the attack profiles and some weapon trails to an AdvancedSwordCore when I ran across some issues. It made sense to move the weapon trail functionality to an AdvancedWeaponCore class and have my AdvancedSwordCore class inherit from that instead. Unfortunately, BasicMeleeAttack is trying to reference a SwordCore type which is no longer in my class chain. I believe my only alternative at this time is to either modify the WeaponCore and/or SwordCore OR create an AdvancedMeleeAttack motion which is identical at this point but references my classes instead.
     
    Last edited: Feb 16, 2021
  12. claudius_I

    claudius_I

    Joined:
    May 28, 2017
    Posts:
    177
    Hi. I have a problem.

    my idlePose is very long (2 second) and when i trigger a simple animation, this wait to finish the idle Pose Animation. there is a wayto i can a fix that?

    Thanks
     
  13. limpin_jezus

    limpin_jezus

    Joined:
    Nov 20, 2015
    Posts:
    18
    I am using the message dispatcher to send a message to the Motion Controller to update a motion parameter thus:
    in start...
    #if USE_MESSAGE_DISPATCHER || OOTII_MD

    MessageDispatcher.AddListener("StatUpdate", HandleStatUpdate, false);

    #endif
    ...

    private void HandleStatUpdate(IMessage incomingMessage)
    {
    var stat = (CombatNode.NODE_STATS) incomingMessage.Data;

    if (stat._name != "MOVE_SPEED")
    {
    incomingMessage.IsHandled = true;
    return;
    }

    var walkRunPivotV2Motion = this.GetMotion(0, typeof(WalkRunPivot_v2)) as WalkRunPivot_v2;

    walkRunPivotV2Motion.RunSpeed = stat.curValue;
    incomingMessage.IsHandled = true;
    }


    This works perfectly, EXCEPT when the character is first loaded. It changes the walkRunPivotV2Motion.RunSpeed parameter, as evident by logging the value to the console after the change, however, looking at the Inspector, the motion Run Speed value is not modified.

    I can't seem to put my finger on what is further modifying the motion parameter; perhaps an initialization? At any rate, if I delay the message via the sender, by a few milliseconds it resolves the issue, but that's unstable at best. Any suggestion for what I can check in my HandleStatUpdate method to ensure the motion is good to go before I modify it?
     
  14. mick129

    mick129

    Joined:
    Jun 19, 2013
    Posts:
    131
    For the spell and the combat system, I saw in your video that you always click on an icon to cast something.
    Can the spells be keybinded instead, and does your asset "Easy Input" cover that?

    Edit: any Ultimate Inventory system integration? :)
    Edit2: One last pre-buy question!
    If I use Ooti and all the modules for the combat system, can integrate it with Behaviour Designer without too much effort?
    All I need is a function that tell the AI to call X attack/spell, and have the movement/targeting controlled by Behabiour Designer
     
    Last edited: Feb 28, 2021
  15. Falondrian

    Falondrian

    Joined:
    Nov 1, 2017
    Posts:
    16
    Hey Tryz,

    I have the same issue as here (though the spell editor seems usable now): https://forum.unity.com/threads/motion-controller.229900/page-140#post-5999531

    Have you gotten anywhere with a solution? I suspect more and more people have high res screens with dpi scaling activated. I also want to keep it activated in Unity, otherwise everything will get blurry. I don't have this issue with any other assets (and I have quite many), the solution must be quite straight forward. Unfortunately the ooti component editors all look broken without the icons...
     
  16. CATByte_Studio

    CATByte_Studio

    Joined:
    Jun 4, 2018
    Posts:
    6
    Good day everyone,

    I am using Saljas' mobile input (https://forum.unity.com/posts/5323017/) and its working great for all the actions like Sneak, Run, Cover, Jump etc. except for switching weapons, stored in the BasicInventory script included with ootii.

    Switching weapons works fine with the keyboard.

    To get it working with virtual buttons; I attached the MobileInputSource script to the Input source, and I attached the Input Source to the BasicInventory script.

    Saljas' demo includes a ButtonHandler script which I use to send the ActionAlias to the InputSource to be read and executed.

    However, the BasicInventory script does not read the ActionAliases the ButtonHandler script is sending (in this case- Equip Pistol or Equip Rifle), whenever the Virtual Button its attached to; is pressed.

    Please help, any advice would be appreciated, thanks :)

    See screenshots below...

    mobile input switching weapons1.png
    mobile input switching weapons2.png
    mobile input switching weapons3.png
     
  17. Recon03

    Recon03

    Joined:
    Aug 5, 2013
    Posts:
    553

    Not sure which version of Unity or MC you are using... either way, be sure to debug when the button is pressed for which ever is not working..

    The basic inventory, you may need to edit, for any sort of mobile inputs, in the past I had to do this, its been a bit since I looked at Tim's basic inventory, so he may have added since I used it.. follow along with this.
     
  18. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    938
    Sorry for the late response.

    You are correct; you'll need to modify one of those classes or create your own attack motion. It would probably be better if the BasicMeleeAttack motion referenced an ISwordCore interface instead of the SwordCore implementation.

    I would probably offload the weapon trails to a separate component, rather than including that functionality in a WeaponCore-derived class. I've already experimented with moving all of the sound effects out of SwordCore into a separate component, abstracted behind an IWeaponAudioCore interface (so you could have different components implementing IWeaponAudioCore for different audio solutions, such as WeaponUnityAudioCore or WeaponMasterAudioCore). This was working pretty well, so I would use the same approach for weapon trails and other visual effects.

    I'm thinking from the perspective of extending the ootii framework though; if you're adding visual weapon effects purely for your own use, then the layer of abstraction might be more hassle than it's worth.
     
  19. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    938
    Did you manage to resolve this issue?
     
  20. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    938
    The component which manages the spells (SpellInventory) simply holds them in a List. The demo scene assigns the first 5 spells in that list to the on-screen icons. You would need to write up a bit of script to bind specific keys to those SpellInventory slots.

    Not as of yet (nor has anything been started, to the best of my knowledge). I was thinking of picking up the asset, but I've been mostly away from Unity for the past few months and haven't gotten around to buying it yet.

    There is an integration package for BD on the Motion Vault. It's more or less a quick port of the same integration package available for NodeCanvas. The tasks cover movement, attacks, etc.
     
    mick129 likes this.
  21. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    938
    I don't think that Tim has gotten anywhere with it. I know I certainly haven't.

    It probably is a straightforward solution... unfortunately, I still have no idea what that solution is. It has to be something in the shared Framework code library that draws the custom Editor GUI.

    It's on my to-do list when I'm able to get back to regularly working with Unity again.
     
    Falondrian likes this.
  22. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    938
    BasicInventory only handles the Inventory Toggle and Inventory Switch aliases. It's also hard-coded to handle the numeric keys (1 to 0), each corresponding to the position within the Items collection on BasicInventory.

    The various input aliases used by the Motion Packs (Equip Sword = 1, Equip Bow = 2, etc) are handled by the BasicItemEquip and BasicItemStore motions, rather than on the inventory component (so that the motion pack isn't dependent on having an inventory). This simple approach clearly doesn't work if you have multiple weapons set up on a character.

    BasicInventory checks GetKeyDown() when testing for numeric key input, so you can't actually bind anything to that. You would need to check the input aliases for the numeric keys and initiate the equip logic on BasicInventory externally. Either that, or inherit from BasicInventory and have it handle your input aliases instead of checking GetKeyDown().
     
    CATByte_Studio likes this.
  23. CATByte_Studio

    CATByte_Studio

    Joined:
    Jun 4, 2018
    Posts:
    6
    Thanks man, I took your suggestion above and it worked out nicely.
    It was staring me in the face all along, i knew it. lol
    The development can continue finally!


    Much thanks again!;)
     
    TeagansDad likes this.
  24. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    938
    You're welcome! Glad I could help.
     
  25. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    938
    Just wanted to let you know that I've figured this out!

    The code for drawing the custom inspectors loads a texture and assigns it to a GUIStyle.normal.background for the corresponding style (for the title box, ootii icon, etc). The property normal is a GUIStyleState. For high resolution screens, the background images used by the state need to be specified in the scaledBackgrounds property, and such images should be exactly twice the resolution of the image specified in background.

    I don't have a high DPI display, but I can reproduce the issue if I set my display scaling to 125% or greater. I did a quick fix and got the ootii Icon and TitleBox GUIStyles drawing properly again:

    upload_2021-4-13_18-48-6.png

    However, there are a lot of Editor GUIStyles to fix up, so I don't recommend fixing it yourself (unless you absolutely need to). I'll do an extensive sweep through all of the custom inspectors this week and ensure that I've added scaledBackgrounds where necessary (and I also need to create double-resolution images for those as well).

    I'll post again here when I'm done. Sorry for the long wait in getting this fixed.
     
    Subliminum, ledshok and Falondrian like this.
  26. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    938
    I have fixed the high DPI monitor display issues with all of the ootii custom inspectors. Fixed the Spell Editor too, with the caveat that if you move the Spell Editor window between high and low DPI screens, the node panels on the left don't draw properly until you restart Unity. Not sure how to fix that, but I'll keep looking into it.

    Not sure when we'll be able to push out a new version to the Asset Store, but in the meantime, PM me if you need the fixes. In addition to the universal fixes in Framework_v1 files, I had to modify some files specific to Camera Controller, Bone Controller, and the Spellcasting Motion Pack, so let me know which of those you need.
     
    dmenefee likes this.
  27. Invirtuo

    Invirtuo

    Joined:
    Nov 30, 2016
    Posts:
    12
    Hi,

    I would like to know how to trigger your Basic Interaction module other than using the INTERACT alias. It's for using on an NPC. Is it possible to call it manually by script? I have look at the code but I can`t find a way to call it by another script.Can you give me a quick example?
     
  28. unity_zI0bplWwlBVpmA

    unity_zI0bplWwlBVpmA

    Joined:
    Feb 22, 2020
    Posts:
    1
    aaaaaaaa.JPG Hello! So i followed the videos and i am sure 100% that i did everything right for the archery motion pack setup
     
unityunity