Search Unity

  1. Calling all beginners! Join the FPS Beginners Mods Challenge until December 13.
    Dismiss Notice
  2. It's Cyber Week at the Asset Store!
    Dismiss Notice

Motion Controller

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

  1. devstudents

    devstudents

    Joined:
    Feb 18, 2014
    Posts:
    133
  2. devstudents

    devstudents

    Joined:
    Feb 18, 2014
    Posts:
    133
    Just thought I'd show you guys my folder as I know most problems come from handling the meta files incorrectly
     
    Tryz likes this.
  3. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    802
    @devstudents - when you see the "IndexOutOfRangeException: Index was outside the bounds of the array" error MotionControllerLayer.UpdateMotions(), it usually means that your MotionLayers (on MotionController) and Animator layers don't have the same number. There should be one Motion Layer for each Animator layer.
     
  4. Salja

    Salja

    Joined:
    Mar 23, 2017
    Posts:
    322
    devstudents likes this.
  5. devstudents

    devstudents

    Joined:
    Feb 18, 2014
    Posts:
    133
    Thanks guys, manually dropping it in fixed it. I thought of that, but I thought the animator was supposed to be added at runtime. Still have issues with the arrows not hitting anything. I saw the crosshair is deprecated and needs to be replaced. I guess I'll just keep plugging away at it.
     
  6. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    802
    Have you tried using the Character Wizard to set up an Archer in a different scene? It should add the Reticle to the scene and it worked the last time I tried it.

    There's an updated Reticle component that you can use instead of the Targeting one, although they should both still work. I think the component in the archery demo scene might be missing the references to the crosshair images.

    When I get a chance, I'll do a pass over the demo scenes and fix whatever isn't working right.
     
  7. Salja

    Salja

    Joined:
    Mar 23, 2017
    Posts:
    322
    I Update the Demo for you and Replace the Old Crosshair Component with the new Reticle Component and fix the missing AnimatorController.



    Try it

    If this will not work for you try to go to each Enemy (Actor Controller) Compinent and click "Auto Create" sice the last Update i have similar problems

    Screenshot_4.png
     

    Attached Files:

    Last edited: Apr 26, 2019
    devstudents likes this.
  8. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,225
    I've updated the Archery Motion Pack.

    I'm sorry for the hassles. I moved some files and it caused havoc across different versions. This is the pain of trying to keep assets in sync across 4 versions of Unity (5, 2017, 2018, and now 2019).

    I tested and the demo works out of the box now.

    Again, sorry for that.

    @Salja and @TeagansDad , thanks for jumping in! I really do appreciate it.
     
    mandisaw, devstudents and hopeful like this.
  9. Censureret

    Censureret

    Joined:
    Jan 3, 2017
    Posts:
    218
    @Tryz Hey guys. i have this character that thas multiple LODS like so:

    upload_2019-4-27_22-9-20.png

    Now as you can see each of the individuals LOD's are exported with a bone structure (something which I cannot change). My question is where should I add the motion controller? if I only add it to the LOD0 it will only apply to that single instance meaning that the other LOD's will not be covered by the motion controller and therefore no animation will play.

    So what is best practice in these situations (and if you guys know the answer for Final IK that would be super helpful aswell)
     
  10. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,225
    Unfortunately, I don't believe this will work. It's not an MC issue, but a Unity Animator issue.

    Unity's Mecanim plays through a Unity Animator Controller. That Animator Controller is tied to a single skeleton. The MC then tells the Animator Controller what states to run.

    With multiple skeletons, Unity would need multiple Animator Controllers running at the same time.

    Typically, it's not the skeletons (roots) that are used in LODs. It's usually the skinned meshes that's tied to a single skeleton (root). I suppose not having to animate facial bones when a character is far away is a good thing, but I've never seen it happen like that. Maybe someone else has.
     
    hopeful likes this.
  11. Censureret

    Censureret

    Joined:
    Jan 3, 2017
    Posts:
    218
    @Tryz Okay so for now ive removed the bone structure and taken the skinned mesh render to the LOD0
     
  12. Censureret

    Censureret

    Joined:
    Jan 3, 2017
    Posts:
    218
    Which after testing does not work
     
  13. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,225
    Probably because the skins from the other levels are tied to the bones of the other levels.

    I'm not sure who the modeler is, but you probably want to address it with them.

    Again, this isn't an MC issue. It's how Unity handles skeletal animations:

    1. Have a single skeleton
    2. Have multiple skinned mesh LODs associated with the single skeleton
    3. Unity animates the single skeleton and distance controls which skin shows

    That's how characters are typically made.
     
    mandisaw and TeagansDad like this.
  14. Censureret

    Censureret

    Joined:
    Jan 3, 2017
    Posts:
    218
    @Tryz So i wrote on their forums to fix it thank you for your response.

    One last thing. The new AttackStyles update where you set the attack profile to each indivudal item. With that how can i get the debug field of view gizmo to appear? i can't seem to make it work?
     
  15. devstudents

    devstudents

    Joined:
    Feb 18, 2014
    Posts:
    133
    Hello. Sorry to interject. Just want to thank you for fixing the demo scene in the archery pack so quickly. Works perfectly now. My only other concern is that the default keys in the Sword and Shield demo scene don't work correctly. Lock-on is 'y' (which I can't find in the documentation) and the alt button doesn't seem to block. I'm sure I could change it manually, but just thought I'd let you know how it appears out of the box atm in Unity 2018.3.12f1
     
  16. devstudents

    devstudents

    Joined:
    Feb 18, 2014
    Posts:
    133
    Here's the input list. I can find buttons for all the actions that work (y for lock-on, shift for run, LMB for attack, ctrl for attack). Can't see block. I did see dodge with 'q' though which was super exciting as I need dodging in my game, but pressing q doesn't seem to activate a dodge.
     

    Attached Files:

  17. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    802
    @devstudents - The Mixamo Sword & Shield animations don't have any for dodging, so the motion pack doesn't set up the Basic Dodge motion.

    I adapted the original BowDodge motion into a generic BasicDodge when building my motion packs for Kubold's animation sets (which do have dodge animations) and then added it to the base Motion Controller files.

    I also found that if you mirror the archery dodge animations, the foot placement is close enough to use them with the sword and shield animations (at least as a placeholder). If you use the Character Wizard to set up your character, I think that it will create BasicDodge states for the sword and shield pack using those mirrored animations (it checks to see if the archery pack is installed). If you click the "Advanced" tab you can add both Sword & Shield and Archery as modules and it will set both up for you.

    The Combat Block action is assigned to mouse 1 (right button) by default. The list you posted is missing the Equip Sword alias, so I can tell that you missed setting up the inputs for Sword & Shield. :)
     
    Tryz likes this.
  18. ve110cet

    ve110cet

    Joined:
    Dec 11, 2017
    Posts:
    6
    Hi there!

    Progress is being made on my game and I keep adding Ootii assets to it (they all work together really well). Quick question for you...

    I have a number of custom motions that I've put into my game already, but some of them rely on some character attribute in order to function (i.e. double jump flag, available stamina, etc.). How would you suggest that I have a motion check a specific flag or attribute in the player object? I did some searching and I saw that there are attributes like health that are stored in the actor controller but I'd prefer to have the data in the player object rather than down in the actor controller. Ideally, I would like to have a separate class that I attach to the player that a motion could query and change (e.g. hasDoubleJumped is true stops the motion from activating again until the player is grounded again).

    Perhaps this could even lead to using a scriptable object that I could use to generate different characters.
     
  19. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    802
    Just a quick note: the attributes are stored in a component named Basic Attributes (not the Actor Controller). There are also a few state values (integer) that are set on the Actor Core.

    Basic Attributes implements the IAttributeSource interface and can store attribute values of several types (int, float, string, bool, tag, Vector3, GameObject, etc). So it can handle what you want to do.

    For that particular example, you might be better off just tracking that within a custom jump motion, as the jump motion could track whether it can reactivate without needing to check a value on another component.
     
  20. ve110cet

    ve110cet

    Joined:
    Dec 11, 2017
    Posts:
    6
    Thanks for the quick reply!

    Would you happen to have any example code on how my custom motion can access that data? Also, how that data (let's say stamina) could be modified (depleted) when the player is within a trigger?
     
  21. yashi393

    yashi393

    Joined:
    Jan 21, 2018
    Posts:
    4
    Does anyone have bunch of "type or namespace" issues with Shooter Pack? My steps:
    New Unity 2018.2.13f1 project.
    Import V2.69 TPC (since shooter pack says it requires 2.68+).
    Import Shooter Pack.

    I get 182 errors like these:
    https://imgur.com/ufOyMVQ
    https://imgur.com/I8rUSzD
     
  22. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    4,961
    Try loading them in a completely empty, new project. It sounds like they are conflicting with a script in your current project that isn't using namespaces.
     
    Tryz likes this.
  23. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,225
    Hey @yashi393 ,

    Those errors happen when the Motion Controller isn't installed. I'm currently at version 2.803. Please make sure you're installing the latest asset:
    https://assetstore.unity.com/packages/templates/systems/third-person-motion-controller-15672

    If you want to email tim@ootii.com your Unity Invoice ID, I might be able to help more.
     
    hopeful likes this.
  24. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,225
    Hey @ve110cet ,

    Check out this page on the Basic Attributes. There's a section called "Code" that will give you some examples for getting and setting attribute values.

    For doing it when you enter a trigger area, just tap into Unity's standard OnTriggerEnter() function in a separate function and use the code you find above.

    For doing it from your custom motion, just grab the BasicAttributes reference from the motion like this:

    BasicAttributes lAttributes = mMotionController.gameObject.GetComponent<BasicAttributes>();

    Then you can get/set any attribute you need.
     
  25. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,225
    They should show up like the other attack styles when you run. Just make sure you add the Graphics Manager to the Camera:



    Then, make sure you enable debugging for all the MC motions. You'll find this at the bottom of the Motion Controller component:



    Once you do that, the gizmos should appear.
     
  26. StevanJay

    StevanJay

    Joined:
    Feb 5, 2014
    Posts:
    75
    Hey Ootii folks! Some questions to help me get a deeper understanding of the Sword and Shield motion pack.

    First, I'm wondering why the weapon attack animations transition to an idle exit pose, rather than transitioning directly to the idle animation? At the moment, it just seems to be creating a very small window where the player can't attack, even though it feels like they should be able to, since the idle exit has no transitions to attacks.

    Second question - can I put a BeginChain event before an EndFOA event? What will happen in that case, will the FOA end automatically when the chain attack starts?

    More generally, I'm not very clear on exactly how the chain transitions work - I've set up the chain start and end events, and the transition between the two animations, but it's not clear how those fit together. I can activate the chained attack if it falls between the two events, but how does that then fit in with the animation transition? What happens if I chain an attack and the transition would already be fully complete? Or if I chain an attack before the transition has started? Will it wait until the transition time to start the new attack? Or do I need to manually ensure that the timing for the start and end chain events corresponds to the transition between the two animations?

    Many thanks, hope my questions are clear!

    Stevan :)
     
  27. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,225
    Hey @StevanJay

    I did it this way so that I could control the look of each exit transition. The animations transition to the Idle Pose Exit with times that help them look right. Then, from Idle Pose Exit to the Basic Idle SM the transition is near immediate.

    I've never tried doing that. The expectation was that the chain would always occur after the current attack. If you do it before, than you would be re-starting the attack motion (with a different style) before the previous attack finishes. That may not be horrible, but it wasn't what I was thinking.

    The idea with chaining wasn't super complex. It was just a way to start an attack while you were in the previous one. For example, with the slash you can chain directly into back-slash without having to go to idle first. With all the other attacks, the default is that you go to idle and then into the next attack.

    You can see that by looking at the transitions between slash and back-slash in the BasicMeleeAttack-SM sub-state machine. Other than slash and back-slash, I didn't create a complex interlinking set of attacks in the sub-state machine, but you could. I just didn't feel any of the animation chained that well. If you have other attack animations, they might.

    The timing of chaining is really based on two things:
    1. When you allow chaining to happen using the animation events you mention
    2. The transitions that are setup and the times set

    Once the player activates the chain between the animation events, the animator parameter will change. Then, it's up to how you setup Unity's animator. In the case of the BasicMeleeAttach-SM and slash and back-slash transition, I don't have a specific Exit Time set. So, the transition occurs immediately.

    I Hope that helps.
     
    StevanJay likes this.
  28. StevanJay

    StevanJay

    Joined:
    Feb 5, 2014
    Posts:
    75
    Cool, thanks @Tryz for the detailed reply, that is very helpful! :)
     
  29. Censureret

    Censureret

    Joined:
    Jan 3, 2017
    Posts:
    218
    @Tryz

    So i did what you said and it "sort of" worked. When i do my attacks all i get is this "square" around my weapon:
    upload_2019-5-2_15-37-20.png


    upload_2019-5-2_15-38-22.png

    Have i done something wrong in the setup?
     
  30. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    802
    @Censureret - There are two means of determining hit detection with the Sword and Shield Motion Pack.

    If you're using colliders for hit detection, then you'll just see the box collider drawn on the weapon model (as in your image).

    The field of attack is only used (and drawn) if you don't have a collider on your weapon prefab.
     
  31. Censureret

    Censureret

    Joined:
    Jan 3, 2017
    Posts:
    218
    @TeagansDad Where in the options do you set it to use either colliders or field of view?
     
  32. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    802
    If there is a collider on the weapon prefab, it will use the collider; otherwise it will use the field of attack.
     
    Tryz likes this.
  33. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,225
    Check out pages 8-11 of the Sword & Shield User's Guide, it explains the two approaches and when they come into play. As @TeagansDad said, it's just a matter if the weapon has a collider or not.
     
  34. Cyrill9

    Cyrill9

    Joined:
    Oct 7, 2016
    Posts:
    8
    Greetings!
    My apologies if this question was already answered before, but do you plan to update the asset to ECS when it will be officially released, and if so, do you plan to charge the owners of the asset for the update, or change the price of the asset?
     
  35. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    802
    I can't speak for @Tryz, but given that ECS is a fundamentally different design paradigm, I don't really see any existing assets being "updated" to use ECS. You may very well see assets with familiar names rewritten to use ECS, but they will essentially be completely new products. It would probably be less work to write new systems from scratch with a solid understanding of ECS than it would be to try and refactor existing object-oriented systems to use ECS.
     
    Tryz likes this.
  36. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,225
    Hey @Cyrill9 ,

    I'm playing with ECS now, but it will be a while before ECS itself is solid enough for a production asset. It's a vastly different development approach which means lots and lots of new work. As for how I would roll that out... I don't know yet.
     
    Last edited: May 4, 2019
  37. KLWN

    KLWN

    Joined:
    Apr 11, 2019
    Posts:
    26
    Hi! I would like to buy the Motion Controller Package together with the Swimming Motion Pack, but before I have a question,. Is it possible to hang on a ledge or move on ledges? Also is it possible to drop from ground and catch a ledge?
     
    Last edited: May 6, 2019
  38. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,225
    On the Asset Store page are links. One of them says "Web Demo". That will allow you to run my climb demo. You just may need to hit the "Next" button a couple of times.

    There's also a link to YouTube videos. I believe the first one has some climbing as well.
     
  39. TekPhreak

    TekPhreak

    Joined:
    Jul 4, 2013
    Posts:
    3
    Hi, I just purchased the spell casting pack and am having an issue in the editor with the components being 'squished' (image below, image on right). It only seems to happen if I have the spell casting pack installed and when I expand the Motion Controller. I do not have this issue with the archery pack (see image below). I have installed only the motion controller and spell casting pack in a new project and the issue still occurs in the spell casting demo scene. I am using Unity 2019.1.0f2. Any help is greatly appreciated. Thanks.

    MCSP.PNG
     
  40. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    802
    @TekPhreak - When an inspector gets messed up like that, it is virtually always due to an exception being thrown in the code that draws the custom inspector. I actually fixed this a couple of months ago, but the updated file didn't seem to get merged into the main code repository correctly.

    In the file Assets\ootii\Assets\MotionControllerPacks\SpellCasting\Code\Actors\Motions\SpellCastingPackDefinition.cs, find the OnPackInspector() method (at line 61) and replace it with this:

    Code (CSharp):
    1. public new static bool OnPackInspector(MotionController rMotionController)
    2.         {
    3.             DrawStandardHeader(PackName, "http://www.ootii.com/Unity/MotionControllerPacks/SpellCasting/SpellCasting_UserGuide.pdf");
    4.  
    5.             try
    6.             {
    7.                 EditorGUILayout.BeginVertical(EditorHelper.Box);
    8.                 if (mDefaultSpell == null) { mDefaultSpell = GetDefaultSpell(); }
    9.  
    10.                 EditorHelper.IntField("Animator Layer", "Layer onwhich we'll create SOME of the sub-state machines and motions. Some motions (ie movement motions) should always be on the first layer.", mAnimatorLayer);
    11.                 mAnimatorLayer = EditorHelper.FieldIntValue;
    12.  
    13.                 EditorHelper.BoolField("Create Mecanim", "Determines if we create/override the existing sub-state machine", mCreateSubStateMachines);
    14.                 mCreateSubStateMachines = EditorHelper.FieldBoolValue;
    15.  
    16.                 EditorHelper.BoolField("Create Motions", "Determines if we create the motions", mCreateMotions);
    17.                 mCreateMotions = EditorHelper.FieldBoolValue;
    18.  
    19.                 EditorGUILayout.EndVertical();
    20.  
    21.                 EditorGUILayout.BeginVertical(EditorHelper.Box);
    22.  
    23.                 EditorHelper.BoolField("Create Input Aliases", "Determines if we create input aliases", mCreateInputAliases);
    24.                 mCreateInputAliases = EditorHelper.FieldBoolValue;
    25.  
    26.                 EditorHelper.BoolField("Create Inventory", "Determines if we create/override the existing inventory", mCreateInventory);
    27.                 mCreateInventory = EditorHelper.FieldBoolValue;
    28.  
    29.                 EditorHelper.BoolField("Create Spell Inventory", "Create the spell inventory for the caster", mCreateSpellInventory);
    30.                 mCreateSpellInventory = EditorHelper.FieldBoolValue;
    31.  
    32.                 EditorHelper.ScriptableObjectField("Default Spell",
    33.                     "Name of the spell to add as the default to the Spell Inventory", mDefaultSpell,
    34.                     typeof(Spell));
    35.                 mDefaultSpell = (Spell)EditorHelper.FieldObjectValue;
    36.  
    37.                 EditorHelper.BoolField("Create Attributes", "Determines if we create/override the existing attributes", mCreateAttributes);
    38.                 mCreateAttributes = EditorHelper.FieldBoolValue;
    39.             }
    40.             finally
    41.             {
    42.                 EditorGUILayout.EndVertical();
    43.             }
    44.        
    45.             EditorGUILayout.Separator();
    46.            
    47.             if (GUILayout.Button(new GUIContent("Setup Pack", "Create and setup the motion pack."), EditorStyles.miniButton))
    48.             {
    49.                 SetupPack(rMotionController);
    50.                 ShowCompletedDialog(PackName);
    51.                 return true;
    52.             }
    53.  
    54.             return false;
    55.         }
    (Wrapping the EditorGUILayout.BeginVertical() in a try { } block with EditorGUILayout.EndVertical() in the finally { } block ensures that the vertical layout group is closed off in an exception is thrown.)

    In the same file, also replace the GetDefaultSpell() method (now at line 303) with this:

    Code (CSharp):
    1. public static Spell GetDefaultSpell()
    2.         {
    3.             Spell lDefaultSpell = null;
    4.             string lSpellPath = DefaultPaths.Root + "Assets/Spellcraft/Content/Data/Spells/MagicMissile.asset";
    5.             try
    6.             {
    7.                 lDefaultSpell = AssetDatabase.LoadAssetAtPath<Spell>(lSpellPath);
    8.             }
    9.             catch
    10.             {
    11.                 Debug.LogWarning("Could not load Default Spell at path: " + lSpellPath);
    12.             }
    13.  
    14.             return lDefaultSpell;
    15.         }
    I'll make sure this fix gets into the next update.
     
    Erelos and Tryz like this.
  41. TekPhreak

    TekPhreak

    Joined:
    Jul 4, 2013
    Posts:
    3

    Thanks for the solution and quick reply! Working as expected now.
     
  42. jnbbender

    jnbbender

    Joined:
    May 25, 2017
    Posts:
    321
    Problem setting up Shooter Pack. The tutorials are not up to date since they talk about adjusting the "Basic Shooter Empty" script. So I do setup the pack and I get the weapon scripts on the Character. Then I noticed a gun is setup with a Gun Core, etc. If I adjust the rotation of the Gun in my hand I get a "slightly" better placement but is there anyway to properly place the gun (IK)? I also have a twisting issue when the gun is placed.
     
    Last edited: May 9, 2019
  43. Salja

    Salja

    Joined:
    Mar 23, 2017
    Posts:
    322
    Hey checkout this page https://ootiigames.com/?page_id=1028
     
    Tryz likes this.
  44. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,225
    It's good to talk about the Basic Shooter Empty motion.
    Basic Shooter Empty

    I expect guns to have a Gun Core. I talk about how the system works here:
    Shooting

    @Salja is right. Check out these pages of documentation:
    Position & Rotation
    Spine IK

    Maybe we're missing something. Please let me know if you mean something else. :)
     
  45. Dermestes

    Dermestes

    Joined:
    Aug 9, 2015
    Posts:
    9
    Has anyone setup a Motion Pack for the RPG Character Mecanim Animation Pack by Explosive? I have started the process but it seems like it is going to take a while. And even then I am having to chop up some of the animations into multiple smaller sections to make it work which will make it hard to distribute to anyone else. If anyone has created a pack around these animations please let me know.

    Thanks,
    Dermestes
     
  46. DBrad

    DBrad

    Joined:
    Jan 16, 2013
    Posts:
    4
    Hi all... any help is greatly appreciated on the below...

    We are implementing multiplayer functionality over the ootii framework. At the moment, movement, rotation and attack are synced over the network by sending client input over the network and they are working properly.

    Right now, i am trying to figure out how to sync the aiming/look IK for the rifle. I was going through the code and it seems every animation has it's own IK update function. I've been looking at the IK code in the following scripts.
    BasicShooterAttack.cs line 674
    BasicShooterEmpty.cs line 354

    A function named RotateSpineToDirection seems to be called at the end of the IK logic. So, I am wondering if it will be enough to send the arguments of this function over the network to sync the aiming IK. Or are there other parameters governing it? Also wondering if there is a simpler way to sync all of the IK at once (atleast for a single weapon), instead of sending parameters for each motion/animation? Any help would be greatly appreciated :)
     
  47. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    802
    Any changes you make to the animation files (such as splitting an animation into multiple takes) are stored in the .meta files for that .fbx file. So you would just need to zip up the .meta files and include that (the same way that the official motion packs include them).

    I don't know of anyone who has created motion packs for these animations.
     
    Tryz likes this.
  48. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,225
    Hi @DBrad , I just shot you this email:

    Make sure you check out this post and video on Multiplayer:
    https://ootiigames.com/?p=1102

    For RotateSpineToDirection, I would think it would happen automatically if you’re sending user inputs. If you look at the arguments from BasicShooterAttack.cs, they are mostly coming from the MC._Transform and the mGunCore.transform:

    Quaternion lTargetRotation = mMotionController._Transform.rotation;
    if (mMotionController._CameraTransform != null) { lTargetRotation = mMotionController._CameraTransform.rotation; }

    mLookIKRotation = mGunCore.transform.rotation;
    mLookIKRotation = mMotionController._Transform.rotation.RotationTo(mLookIKRotation);

    RotateSpineToDirection(mLookIKRotation, lTargetRotation, mLookIKWeight);


    The tricky part could be the “mLookIKWeight”. That ramps up and down as the motions start and stop. This way there’s no ‘popping’.

    You may want to use a break point in the remote code to see what you’re getting for those argument values. I’ve never tried using IK with NPCs. So, it’s possible you’ll have to force the mLookIKWeight value.


    The other thing I'd add is to make sure simulating user input across the network is really the right approach that you want. I *think* most multiplayer games use an authoritative server where all the player's input is sent to the server. Then the clients run the local player's input immediately, but instead of getting input for remote players they get the animation state, health state, position, rotation, etc. The remote character state then controls everything. I'm not saying you have to do it that way, but make sure your multiplayer approach is solid and robust and you are happy with it. Otherwise, that communication flow could be an issue game-wide later. :)


    I hope that helps,

    Tim
     
  49. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,225
    Hey @Dermestes , the animations do look good. I'm not sure if anyone has tried using them. Unfortunately, I don't own them myself.

    Check out this post. It should give you some ideas on how to handle this.
    Using Custom Animations

    @TeagansDad dad is right about the .meta files. While you can't re-distribute the artist's animation files, you can redistribute the .meta file you create. They don't include any actual animation data.
     
  50. Dermestes

    Dermestes

    Joined:
    Aug 9, 2015
    Posts:
    9
    I am slowing getting up to speed on making the motions. Currently converting sword and shield to the new animations. Is there a way to add animation events to read only animations other than editing the .meta file manually? A bit new to Unity and Animations in general.