Search Unity

Motion Controller

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

  1. ppbpmkuro

    ppbpmkuro

    Joined:
    Dec 5, 2018
    Posts:
    6
    Sorry, but I still don't quite understand that.
    And one more issue, I tried to change the equip animation last night, but it didn't work at all. I wasted a few hours again! and finally I found an 'Animation event' that have never been mentioned anywhere.

    'Equip animation need a animation event.'

    finally I angry now. and I noticed that I was spending too much time for study.

    So I bought another product of a similar type to this one.(INVECTOR)
    OMG,It had all the functions I wanted, its internal structure was very intuitive, and its well made website was so much perfect. crucially,It was more friendly to beginners. and There are many additional free functions.
    Its most top-of-the-line version includes all of its sub-products. at a reasonable price.

    Most importantly point is
    after buying it, I was able to make anything I wanted in just 1 hours. All by my self!

    I'm very confused now...I just...
     
  2. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    There are some basic Unity principals that I assume people understand: Unity has animations. Unity animations can have animation events. We use animation events to trigger actions in the game.

    These are defined by Unity in their documentation.
    Unity - Manual: Events

    So, if you change one of my animations that triggers an action. I assume you realize your new animation may need an animation event and you take 10 seconds to look.

    I will absolutely agree that the MC and the framework is not going to teach you Unity. For that, another asset may be better for you.

    I'm glad you found an asset that fits your needs and wish you the best of luck.
     
    Subliminum likes this.
  3. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    You can, but it requires a custom Gun Core. If you inherit from my GunCore.cs, you'll see a function called 'Fire'. You can override this function and do anything you want each time the weapon fires... including instantiating and launching a prefab.

    I just helped someone create a rocket launcher using this approach. :)

    Hopefully the steps flow with the documentation:
    1. You create this custom Rubble1GunCore.cs
    2. You have your own Rubble1RocketLauncher prefab (probably a copy of my M4 prefab.
    3. You remove my GunCore component
    4. You add your Rubble1GunCore component
    5. In the Basic Inventory change the rifle item's Resource Path to point to your new prefab instead of my M4 prefab

    On the Gun Core and Basic Gun Handle components on the M4 prefab is a "Stability" property. Reduce that to 0 to remove recoil.

    Typically recoil requires the player to pull the gun back down for aiming. In your situation, you may not be requiring that. So, we can remove the recoil effect.

    hmmm... This one is tricky. Since the melee attack part requires a totally different animation and all the things I do in the in the Sword & Shield Motion Pack, it won't just work for the Shooter Motion Pack. At the core, the character's state value needs to change to know it can do a melee attack.

    You could code something that changes the character's state to melee, performs the attack, and then goes back to the shooter state. It's not something I've tried.

    Thanks. It's an interesting challenge selling something on the asset store. You get people with all different skill sets, experience levels, and expectations. I'm glad the MC is a match for you. :D
     
    mandisaw and rubble1 like this.
  4. Tryz

    Tryz

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

    You mentioned you watched some videos, but just to confirm... watch this one:


    Check out my demo_NavMesh scene too.

    There are 3 parts to getting characters moving:
    1. The brain to decide you want to move and where (AI)
    2. The navigation to determine how to get there (Nav Mesh)
    3. The legs that move and actually get you there (Driver)
    In a typical NPC setup they match to:
    1. Node Canvas or your custom AI code
    2. Nav Mesh, Nav Mesh Agent, my Nav Mesh Input Source
    3. The Motion Controller
    The video will explain you don't want to use the MoveToDriver because that driver doesn't care about animations. It just moves the GameObject (which is what you're seeing). In your case, the MC is the driver.

    Assuming you are using Unity's Nav Mesh solution, you'll want to use my Nav Mesh Input Source. From your AI, you tell the Nav Mesh Input Source where you want to go (using the Target property). The Nav Mesh Input Source talks to Unity's Nav Mesh Agent and gets a path. That path is then managed and sent to the MC to move, rotate, and animate your character.

    Just make sure your character also has the a walk/run motion.

    The video should help explain all this in gory detail. :D

    The demo is also a working example you can poke around with.
     
  5. ColBashar

    ColBashar

    Joined:
    Mar 17, 2017
    Posts:
    3
    Yeah, that was the obvious thing that I was missing. Thanks for clearing that up for me. For some reason I had it in my head that the MoveToDriver was analogous to the NavMesh follower.

    The SetTargetPosition method is working for me now and that's what I was really looking for from the start. The problem I was having was that I had accidentally set the target too close to the actor, within its "close enough" range, so that it wasn't motivating. User error, go figure.

    A related question for you since you have a lot more experience working with Unity than I do. I'm building an RTS style game and to limit complexity, I'm planning to organize units into squads, the squad being an invisible actor that handles long range navigation. Therefore, the more numerous units assigned to a squad only have to follow it and can operate with a less intensive pathfinding algorithm.

    Since the units will be making short trips in generally flat open areas, my plan was to motivate them directly using SetTargetPosition. My question for you is, do you think this would reduce complexity over using the NavMesh agent to be worthwhile? Or is the NavMesh agent optimized so that it can handle short, direct trips just as efficiently?
     
  6. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    Hi, some of my players met this issue when initializing my game:

    FormatException: Input string was not in a correct format.
    at System.Number.ParseSingle (System.String value, System.Globalization.NumberStyles options, System.Globalization.NumberFormatInfo numfmt) [0x00083] in <f2e6809acb14476a81f399aeb800f8f2>:0
    at System.Single.Parse (System.String s, System.Globalization.NumberStyles style, System.Globalization.NumberFormatInfo info) [0x00000] in <f2e6809acb14476a81f399aeb800f8f2>:0
    at System.Single.Parse (System.String s) [0x0000b] in <f2e6809acb14476a81f399aeb800f8f2>:0
    at com.ootii.Geometry.Vector3Ext.FromString (UnityEngine.Vector3 rThis, System.String rString) [0x00049] in <e62782007a9443f9a276bcbef0c34d46>:0
    at com.ootii.Actors.AnimationControllers.MotionControllerMotion.DeserializeMotion (System.String rDefinition) [0x0027a] in <e62782007a9443f9a276bcbef0c34d46>:0
    at com.ootii.Actors.AnimationControllers.MotionControllerLayer.InstanciateMotions () [0x0015a] in <e62782007a9443f9a276bcbef0c34d46>:0
    at com.ootii.Actors.AnimationControllers.MotionControllerLayer.LoadAnimatorData () [0x00000] in <e62782007a9443f9a276bcbef0c34d46>:0
    at com.ootii.Actors.AnimationControllers.MotionController.LoadAnimatorData () [0x0002b] in <e62782007a9443f9a276bcbef0c34d46>:0
    at com.ootii.Actors.AnimationControllers.MotionController.Awake () [0x00429] in <e62782007a9443f9a276bcbef0c34d46>:0

    They found that change the windows locale to Russian and Ukrainian can cause this issue, change to english will solve it. Any suggestions how to fix it?
     
  7. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    In the Vector3Ext.cs, there should be a line that is forcing the cultural formatting:

    Code (CSharp):
    1. System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("en-US");
    Make sure that isn't commented out. This used to force everything to one numeric format ("0,000.00" instead of "0.000,00"). I know it has helped others, but I believed UWP was an issue because of a bug in Unity.
     
  8. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    The bulk of the work that Nav Mesh Input Source does is just calling out to the Nav Mesh for a path. So, that will be your big performance hit (if there is one). I haven't done any performance testing with Unity's Nav Mesh Agent. You'll want to test that for your situation.

    I've never had any issue with it for short distances, but I've never queued 100's of requests.
     
    ColBashar likes this.
  9. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    Great, thanks!
    In my set of codes it is commented out, I've re-enabled this line, should this fix the locale issue?
     
  10. Gervais60

    Gervais60

    Joined:
    Apr 7, 2016
    Posts:
    37
    Hi All

    I am looking for a good tutorial on how to integrate cut scenes with the ootii Motion controller
    Thanks
     
  11. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    Hi, I've also met this issue when trying to load an old saved game from previous unity version:

    Quaternion To Matrix conversion failed because input Quaternion is invalid {0.000000, 0.000000, 0.000000, 0.000000} l=0.000000
    UnityEngine.Physics:RaycastNonAlloc(Vector3, Vector3, RaycastHit[], Single, Int32, QueryTriggerInteraction)
    com.ootii.Geometry.RaycastExt:SafeRaycast(Vector3, Vector3, RaycastHit&, Single, Int32, Transform, List`1, Boolean, Boolean) (at Assets/ootii/Framework_v1/Code/Geometry/RaycastExt.cs:329)
    com.ootii.Actors.ActorController:processGrounding(Vector3, Vector3, Vector3, Vector3, Single, RaycastHit&)
     
  12. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    The code above should force your numeric format to US style. That would stay consistent. If the save game was done in a different style and then you forced a US style, that could be an issue.

    It also depends on how your "saved game" system works.
     
  13. GamdineProductions

    GamdineProductions

    Joined:
    Aug 18, 2016
    Posts:
    12
    I'm not sure if this is right place to ask.

    "Walk Run Pivot" doesn't work, any ideas why?
    Nothing works except "Basic Walk Run Pivot" what did I do wrong?
    I am using Unity 2018.1.2f1

    Edit: I figured it out, when I changed the Controller in my Animator to "Humanoid " it works!
    I am sorry if this is beginners mistake :)
     
    Last edited: Dec 13, 2018
    hopeful likes this.
  14. StayUpLate

    StayUpLate

    Joined:
    Jul 29, 2018
    Posts:
    59
    You mean using SLATE? We have some decent Slate guys in here. I'll let them catch this :)
     
  15. StayUpLate

    StayUpLate

    Joined:
    Jul 29, 2018
    Posts:
    59
    If you ever again find your motions not kicking in; also check the motion priority and the 'enabled' checkbox behind it :) I've spent way too much time missing simple things like those lol.
     
    GamdineProductions likes this.
  16. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957
    The animator controller that you were using originally probably didn't have the state machine for WalkRunPivot set up on it.

    The non-Basic motions generally contain the code necessary to recreate their own state machines on the animator controller. There's an option tucked away behind the settings button on each motion that will perform this task.

    The Character Wizard just uses the Basic set of motions, plus a few others (climb, jump, etc) at the moment and doesn't handle many of the older motions. Not sure if you were using it, but I figured I would mention it.
     
    GamdineProductions likes this.
  17. digitalzombie

    digitalzombie

    Joined:
    Dec 10, 2007
    Posts:
    86
    Hi,

    Another new guy here, with new guy questions. :)

    I'm using the MMO basic settings and would like to be able to grab the ladder from a jump. Is that possible?

    Thanks!
     
  18. Gervais60

    Gervais60

    Joined:
    Apr 7, 2016
    Posts:
    37
    No looking for tutorial for using Cinemachine to create the cutscene and the ootii motion controller and on how the do the transition from one to the other
     
  19. chin

    chin

    Joined:
    Feb 15, 2011
    Posts:
    7
    I'm using Motion Controller for NPC. When try to activate the backward dodge motion in BasicDodge-SM in Sword and Shield Motion Package using motion controller setAnimatorMotionPhase as below:
    _motionController.SetAnimatorMotionPhase(0, 3370, 100, 1, true);

    I see the dodge animation not finish playing it straight switch to Idle animation. I'm manually set InputAngleFromAvatar in Animator to 0. How to activate such motion manually for NPC? Thanks.
     
  20. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957
    In general, you shouldn't be setting the MotionPhase directly (except inside a motion's script).

    Instead, activate the BasicDodge motion:

    Code (CSharp):
    1. var dodgeMotion = _motionController.GetMotion<BasicDodge>;
    2. _motionController.ActivateMotion(dodgeMotion );
    The animation will start if you use SetAnimatorMotionPhase, but since the BasicDodge motion itself isn't running, the current active motion (BasicIdle in this case) will take over. When using Motion Controller, you'll want to use motions to play any animations, as the motions encapsulate the logic for starting conditions, monitoring for animation events, ending the animation, etc.
     
    mandisaw and chin like this.
  21. chin

    chin

    Joined:
    Feb 15, 2011
    Posts:
    7

    Thanks. After going through your explaination, I'm able to make it work.

    For NPC I'm using NavmeshInputSource as the driver for the motioncontroller. In Actor Controller, I disable the "Use Transform" option to make the NPC able to use root motion and follow the navmesh agent path. I notice everytime I activate the motion such as Idle or BasicMeleeAttack, the Actor Controller "Use Transform" option will be enabled. After it enabled it will disable the root motion of the animation come afterward it such as BasicWalkRunPivot. I have to manually disable it afterward to made the NPC able to go to the target destination. It's the correct way of doing it or exist other option to control the NPC with navmeshagent using root motion?
     
  22. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957
    @chin - You can use the NavMeshInputSource, or you can leave it out and just have Use Transform checked on the ActorController. They will conflict with one another though.

    If Use Transform is getting enabled after certain motions complete, then guessing that you created the character using the Character Wizard, which assumes that the Use Transform option is enabled for NPCs (as it's the simplest). The setup automatically adds the Agent Use Transform Reactor (on the ActorCore); this disables Use Transform when a motion that will often move the character (Attack, Dodge, Death, Damaged, etc) activates. Otherwise, the root motion is disabled and the animation looks goofy. It enables Use Transform when the motion completes.

    Now, the reactor should be checking if Use Transform is set when it initializes; if it's not, then the reactor should basically do nothing. This check doesn't seem to be working as I intended. For now, you can just disable or remove that reactor and the problem should go away.

    I'll add an option in the NPC setup section of the Wizard to choose between the NavMeshInputSource or Use Transform. I figured most people were using the latter approach, but it's easy enough to include the former as an option as well.

    If I'm totally wrong and it's not that reactor, then I need to think about it some more. :)
     
    Subliminum likes this.
  23. johnnycantcode

    johnnycantcode

    Joined:
    Jul 21, 2016
    Posts:
    3
    I just purchased MotionController along with the Shooter motion pack. I start with an empty scene copied from the Shooter demo. I add my T-Pose model to it and run Character wizard. When I press play and then equip the Rifle, the rifle position is wrong but I think I can fix this, but when I fire the weapon, the animation puts my models head between his legs.
     
  24. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957
    @johnnycantcode - Check and see if any of the animator states for firing the gun do no have an animation assigned. If no animation clip is assigned on the base layer, the character will curl up (and usually drop into the ground).

    If that's not what is happening, try disabling all of the UK options on the shooter motions and see how it looks with just the animation clips.
     
  25. LunarLabs

    LunarLabs

    Joined:
    Dec 21, 2016
    Posts:
    17
    Hi OP, hope you can help,

    Sort of getting to the end of my tether with this. Really easy to set up, but I'm burning all of my hobby time just watching hour long videos that don't contain the information I ultimately need.

    I've read and I think I've understood the basic concepts you've put down here, but I have a very simple issue.

    With the sword and shield animset - once you swap into the sword and shield form it just ignores all of the nice animations, movement etc set up in the original form and the controls completely change from the shooter/strafe style I have set up to this really basic adventure style.

    Here's what I've tried (from your documentation)
    • Changing the layer priorities so the WalkRunStrafe v2 has a higher priority (Nothing happens)
    • Disabling the Basic Walk Run Pivot (The character just can't move when he's in his SnS form)
    • Adding the WalkRunStrafe v2 animations into the Basic Walk Run Strafe that the form is absolutely determined to use (Sort of works but the character still wants to turn instead of strafe and it jams everything up).
    Is there a video, or a very simple explaination that you can give me which will explain how I can keep the original form motions when swapping to the SnS form.

    I have looked absolutely everywhere, read through every shred of documentation in regards to editing forms and I can't find any information on exactly how to edit a form.
     
  26. b152349

    b152349

    Joined:
    Feb 8, 2018
    Posts:
    17
    Has anyone had success using this for a first person game? Would love to see examples on how this is done. I haven't found any first person controllers with spell casting built in though I may have missed some. I saw this author's post discussing it theoretically but I don't want to go down the rabbit hole without more to go on.
     
  27. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957
    @LunarLabs - I'm just out at lunch right now, but when I'm back at my desk I'll type up the solution (and explanation for) your issue
     
  28. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957
    The Sword & Shield Motion Pack defaults to adventure-style movement when the weapon is equipped, but switches to shooter/strafe style movement when the player is locked on to a target (middle mouse button when close to an enemy with a Combatant component attached).

    If you want to simply use the strafe style movement all of the time, un-check the "Activate With Target" option on the BasicWalkRunStrafe motion and clear the Activation Alias field:

    upload_2018-12-18_12-37-44.png

    upload_2018-12-18_12-44-4.png

    As long as BasicWalkRunStrafe has a higher priority than BasicWalkRunPivot, it should activate in response to movement input (default priority is 7 for strafe motion and 5 for the pivot motion).

    If it doesn't work for you, try setting up a new character in a new scene. I just confirmed this now by using the Character Wizard (in basic mode) to create a "Melee Warrior." I made those two changes to the BasicWalkRunStrafe motion and the character was defaulting to strafe-style movement.

    If you're using Camera Controller, you probably want to change the default camera motor from a 3rd Person Follow to a 3rd Person Fixed; otherwise, the view (and thus the character movement) will be turning in the direction of the strafe movement.

    I don't suggest that you mix the BasicWalkRunX motions with the older WalkRunX_v2 motions, as the Basic set of motions are designed to work as a set.

    Now I'll get into the explanations. :)

    The original versions of the Sword & Shield and Archery Motion Packs included their own Idle, WalkRunPivot, WalkRunStrafe, Damaged, Death, Attack, etc motions. It wasn't so bad if you were just using the Motion Packs and their default animations, but once you start adding more animation sets, you end up having roughly 10 motions for each set of animations. I was in the process of setting up several of Kubold's animation packages to use with Motion Controller, and I was finding it very tedious and time-consuming to have to create so many duplicate scripts that basically only differed in which animation clips they used (It was also tedious to have to add and configure that many motions on each character who could use each type of weapon). So I talked to @Tryz about it and the Basic set of motions were the result.

    The Basic set of motions allow you to use the same motion script with as many different animation sets as you want, with the new Motion Form parameter being used to determine which animation clip(s) to play. This was a massive time-saver, both when putting together new motion packs but also when setting up a character.

    So with the official Motion Packs, the default Motion Form values are:

    • 0 - Default (unarmed)
    • 100 - Sword & Shield
    • 200 - Archery
    • 300 - Spellcasting
    • 500 - Rifle (Shooter MP)
    • 550 - Pistol (Shooter MP)
    If you are defining your own Motion Forms for use with other animation sets, you might want to use a range of values to represent a general class of animations. For example, my set of Motion Packs for use with the animations published by Kubold and Riko use:
    • 1000 - Movement Animset Pro
    • 1001 - Female MAP
    • 1002 - Blended Male + Female MAP
    • 1100 - Sword Animset Pro
    • 1200 - Sword & Shield Animset Pro
    • 1300 - Rogue Animset Pro (* planned)
    • 2000 - Longsword Animset Pro
    • 2100 - Two-Handed Sword Animset Pro
    • 3000 - Mage Animset Pro (* planned)
    • 3100 - Mage with Staff Animset Pro (* planned)
    • 4000 - Archer Animset Pro (* planned)
    In my case, I set the Default Form on the ActorCore to 1000 (or 1001 or 1002) instead of 0, and my characters will use the Movement Animset Pro animations when unarmed instead of the default ones included with Motion Controller.

    (No, I still haven't posted any of these publicly, but anybody who wants them can PM me to ask for them)

    The older Idle, WalkRunPivot_v2, WalkRunStrafe_v2, etc don't use the Motion Form parameter and make use of a different technique for monitoring which animator state is active and when the animation has completed. Unless you have a specific need for these particular motions, I recommend that you just stick with the Basic set of motions.

    Let me know if you have any questions about what I've just said. :)
     
  29. LunarLabs

    LunarLabs

    Joined:
    Dec 21, 2016
    Posts:
    17
    Firstly, thank you for this comprehensive response. It explained exactly what I was looking for and I was able to get this set up exactly the way I wanted it. My next task is to move onto chaining attack combos and perhaps doing some sort of randomization of attacks, I'm not sure if there's videos out there on this but I'll have a look :)

    Secondly; I've taken onboard your advice regarding the usage of the sets. Thanks for that, that will undoubtedly save me a headache later down the line.

    Thanks for this asset, it's fantastic - and keep up the great work :)

    Kind Regards,
     
    Tryz and hopeful like this.
  30. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957
    @LunarLabs - Glad I could help!

    Just to clarify though: I'm not the author of the asset-- that would be Tim (@Tryz). I have been helping him out support and some updates.

    (And I contributed a few things to the last major update, such as the Character Wizard)
     
  31. KeithBrown

    KeithBrown

    Joined:
    Apr 1, 2017
    Posts:
    191
    In the SSMP demo, for the Basic Melee Attack motion there are no attack styles in the list until you equip the sword in play mode. If in non play mode I hit the reset button on the attack styles then the 7 styles i expect will show up. If i go into play mode again then equip the sword, only the forward slash and back slash remain and the rest are gone. If i move the Spin Slash attack style to the top of the list and modify the next attack styles accordingly, nothing happens. It will always use the Forward Slash and the Back Slash. How can this be changed? Is it in code only or is there something in the setup of the SSMP that I can change?
     
  32. KeithBrown

    KeithBrown

    Joined:
    Apr 1, 2017
    Posts:
    191
    Nevermind, I was able to find the correct video that explained it all.

     
    Tryz and hopeful like this.
  33. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957
    @KeithBrown - The BasicMeleeAttack motion will have the default list of Attack Styles added to it when you set up the motion pack.

    If you're using the Attack Profiles that I contributed for the 2.8 version, then the Attack Styles defined on the motion will be overwritten at runtime when the weapon is equipped by the ones defined in the Attack Profile asset.

    I found that it was difficult to manage Attack Styles for multiple melee weapons when they were all in a single flat list. And because the list index is used for chaining attacks, it was a mess when populating the list from a setup script (as they could be added in any order). So I came up with the idea of defining each weapon's Attack Styles in a separate ScriptableObject asset so that the system could be more modular. But it is an add-on to the original design, so there are a few spots where it may not be as intuitive bad I would like.
     
    mandisaw, Tryz and Subliminum like this.
  34. uni7y

    uni7y

    Joined:
    Jul 23, 2012
    Posts:
    287
    Hi,
    just wondering will the Shooter Motion Pack work with Unity 2018.3 ?
    :)
     
    Last edited: Dec 21, 2018
  35. Tryz

    Tryz

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

    All the assets should work in Unity 2018.3.

    I still use Unity 2018.2, but I'll be going through all the assets with Unity 2018.3 this holiday break just to make sure.

    [EDIT]
    I just did a simple import of my "master project" into Unity 2018.3 and it had some initial warnings, but they all went away. I think there are some function calls Unity has changed that I'll have to account for.
     
    Last edited: Dec 21, 2018
    recon0303, StayUpLate and uni7y like this.
  36. uni7y

    uni7y

    Joined:
    Jul 23, 2012
    Posts:
    287
    Great... Thanks @Tryz
    I have a pile of assets from you in my shopping cart so now I know I can safely buy them later today ;)
     
    KeithBrown, TeagansDad and Tryz like this.
  37. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    Hi Tim,
    One player of my game met an issue with the actor controller and the camera controller in Netherlands.
    The character got stuck in air when he should fall down (looks like the motion is correctly activated, for he is performing the Falling motion, but no movement). And the camera just can't follow the player.
    All stuff works correctly when he changes his OS(Windows) region into EN-US.
    We use unity 2018.2.16f1 and .Net 4.x equivalent. This issue does not occur if we use .Net 2.x equivalent.
    Any ideas why this is happending?

    BTW: I've already enable the culture change line in Vector3Ext.cs and added culture settings in the string parsing part for vector3 and vector4 in the Vector3Ext.cs. The player got no error thrown when this issue occurs.
     
  38. Salja

    Salja

    Joined:
    Mar 23, 2017
    Posts:
    353
    Same here i poke tim sice few months about the problem with .Net 4 i hope can be fixed sometime :D
     
  39. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    @Salja and @Harekelas

    So, this is the problem... I'm expecting Unity to work the same if you're using Unity 2018.2, Unity 2018.3, Unity w/ .Net 2.x, or Unity w/ .Net 4.x, etc.

    When something like swapping .Net 2.x to .Net 4.x makes things break, it's something with Unity's core engine that's inconsistent or broken. Some people have sent me tips about this, but I haven't found a solution that works 100% of the time.

    I've reached out to Unity for an answer and haven't gotten one. Maybe if you reach out too. I'll keep looking for a solution, but there's something wrong with Unity's .Net 4.x implementation and I don't have a quick fix for them.
     
    recon0303, hopeful, mandisaw and 2 others like this.
  40. Salja

    Salja

    Joined:
    Mar 23, 2017
    Posts:
    353
    Then we will hope unity will answer, the new vegetation studio pro need .Net 4 :D thats why i have to change
     
    Tryz likes this.
  41. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    I haven't given up. I just hate that I really have no control over what's happening. :(
     
  42. dfrauzel

    dfrauzel

    Joined:
    Sep 13, 2012
    Posts:
    3
    Hello! I'm looking to create a Skyrim like camera / motion setup. I'm getting close, thanks especially to some (eerily recent) posts here (thanks TeagansDad!), but there's still one last feature I haven't been able to quite figure out.

    Here's the general breakdown: S backpedals, A and D strafe (perpendicular, no rotation), and - here's the kicker - when not armed, the camera orbits the character, but when weapon is ready, the character rotates with the camera. Camera orbit is always-on, no holding down RMB.

    And my setup so far: Basic Walk Run Strafe / Activate with Target unticked and Activation Alias cleared. 3rd Person Fixed camera, no Rotates, so they can be set in MC. Input Source has View Activator set to None. Sword&Shield Pack imported.

    So! The only piece I'm missing is how to switch between two motions, two different Basic Idles I think, depending on the current Form. If Form is 0 then I want the usual Basic Idle. If Form is 100 then I want a different Basic Idle which has Rotate With Camera ticked.

    I have no problem writing some C# for this if needed, just need a nudge in the right direction. :)
     
  43. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957
    You're welcome! :)

    I would suggest building a (simple) custom Reactor to accomplish what you want to do here. You shouldn't even need to have two different Basic Idle motions set up; the reactor will activate when it receives a "weapon set equipped" or "weapon set stored" message and then set the Rotate With Camera property on the BasicIdle motion according to the motion form (which is included a a property on the InventoryMessage that the reactor is responding to).

    You could use the BasicAttackProfilesReactor as a reference for the overall structure, with a different Activate() method:

    Code (CSharp):
    1. public override bool Activate()
    2.         {
    3.             base.Activate();
    4.  
    5.             InventoryMessage lMessage = (InventoryMessage)mMessage;
    6.  
    7.             BasicIdle lIdleMotion = mMotionController.GetMotion<BasicIdle>();
    8.  
    9.             if (lIdleMotion != null)
    10.             {
    11.                 switch (lMessage.Form)
    12.                 {
    13.                     case 100:
    14.                         lIdleMotion.RotateWithCamera = true;
    15.                         break;
    16.                     case 0:
    17.                         lIdleMotion.RotateWithCamera = false;
    18.                         break;
    19.                     default:
    20.                         lIdleMotion.RotateWithCamera = true;
    21.                         break;
    22.                 }
    23.             }
    24.  
    25.             // Disable the reactor
    26.             Deactivate();
    27.  
    28.             // Allow other reactors to continue
    29.             return true;
    30.         }
    For better performance, you would probably want to store the reference to the BasicIdle in a private class-level field that you acquire in the same manner as the component references. Also perform a null check on it in TestActivate() (returning null), and then you can eliminate the null check in Activate().
     
    ader42, dfrauzel, recon0303 and 2 others like this.
  44. dfrauzel

    dfrauzel

    Joined:
    Sep 13, 2012
    Posts:
    3
    Awesome, this is perfect! Thank you so much!
     
    TeagansDad and Tryz like this.
  45. ader42

    ader42

    Joined:
    Jan 5, 2015
    Posts:
    7
    Hi folks,

    Hope someone can advise.

    I've until recently been using BWRS for both my player character and my NPCs.

    This is because I am using nav mesh input sources as the input for both Player and NPC and the BWRP motion will not work with a nav mesh input source.

    I would prefer a nicer pivot movement for my player walking if possible.

    Partly to that end I have purchased Kubolds Movement Animset Pro animations and downloaded both Tim's and TeagansDad's motions from the Ootii vault. The other reason is that I plan on using the Fighting AnimSet Pro motions and figured they'd work better with the MAP motions.

    So far I'm not having any joy getting the desired results with either Tim's or TeagansDad's.

    Neither my player or NPC will work with Tim's "MAP - Walk Run Pivot". Due to my using a nav mesh input source?

    TeagansDad, your "MAP - Walk Run Pivot" motion does work with my NPC characters but won't work with my player character. The difference between the two is that the player motion controller has a Camera Rig specified whereas the NPC motion controller doesn't.

    It seems that the "Rotate With Camera" option doesn't work. i.e. if it's disabled the character still rotates with the camera and not according to the input.
    I tried commenting out all camera related code in the motion files to no avail which has left me somewhat perplexed.
    Is this a known issue and is there a known workaround?

    I also looked at Tim's NPC MAP motions but couldn't get them to work either; similar camera rotation issue.


    Thanks in advance for any advice,

    Ade
     
  46. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957
    @ader42 - I'll certainly try my best to help!

    Both Tim's MAP motions and my MAP motions on the Vault are very old, so I'm not surprised that you're having trouble.

    I'll PM you a link to a mostly-complete set of updates for Movement Animset Pro that works with the Basic set of motions.
     
    ader42 and Tryz like this.
  47. Subliminum

    Subliminum

    Joined:
    Nov 9, 2017
    Posts:
    97
    Hi TeagansDad,
    Ive been working on a project using these animations also. Id love to have a look at your work using the Movement Animset Pro, if that's possible?
    Thanks a bunch!
     
  48. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957
    Subliminum and Tryz like this.
  49. ader42

    ader42

    Joined:
    Jan 5, 2015
    Posts:
    7
    I had decided that it would be best to use TDs Pivot blend trees with the BWRS motion code. I had this working as a test. Then TD was good enough to send me the link to his motions. After looking for 5 minutes at what he has done the sensible path became clear :) I will use TeagansDad's blend trees that are designed to work with the BWRS etc. and not try to mix and match things not designed to work together.

    I must admit I do like the TeagansDad's MAP Idle that has 6 different idle animations so will likely try to implement that functionality too. Would this be best using MotionForm as per Sword & Shield Melee Attack or as MotionParameter as per TeagansDad's Idle? I guess best to keep as per Ootii Sword & Shield for consistency.

    It's actually also made me realise the error of my ways with an enemy NPC motion I have working but not in the best way. (Basically, I sub-classed BWRS and over-rode UpdateRootMotion to remove the "Get rid of root-motion that is not aligned with our input" for the "Zombie Pro" animations). I will instead create new motion code for the Zombie motions (based on BWRS) and use another unique MotionForm value for that.

    Then I can start implementing the Fighting Animset Pro animations for my player as another different MotionForm.

    Can't thank TeagansDad enough, feel pretty excited about how well this will all work again :)
     
    Tryz and hopeful like this.
  50. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957
    @ader42 - You're welcome!

    I do intend to add the idle animation variations again at some point in time. I would probably still use the MotionParameter to determine which animation to play, but either way would work. That way it would be easy to just randomly generate an integer in the motion and pass it to the animator controller. The easiest way to handle this might actually to be with a StateMachineBehaviour; when the Idle state is entered, the attached behaviour generates a random number within a designated range and then you could immediately transition to a different idle animation (or stay on the default one if none of the conditions are met). For this, you could just use a new parameter on your animator controller that you can be sure won't be modified by Motion Controller.

    For consistency, it's probably best to inherit from BasicIdle and adapt the logic from my old MAP_Idle motion. But the StateMachineBehaviour is an alternative that may be simpler.

    You shouldn't need to do this; if you specify the Walk Speed and Run Speed on BWRS, it will use those speed values and ignore Root Motion:

    upload_2019-1-4_14-41-1.png

    Unless the Root Motion is interfering in some other way, that is. In that case, you could try baking transform or rotation values into the animation:

    upload_2019-1-4_14-42-44.png
     
    Tryz likes this.