Search Unity

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

[RELEASED] Horse Animset Pro 3

Discussion in 'Assets and Asset Store' started by Malbers, Dec 22, 2015.

?

Horse Animset Pro 3 Priority Features (* Complexity)

Poll closed Feb 15, 2017.
  1. Combat While Riding (Melee) ***

    13 vote(s)
    50.0%
  2. Combat While Riding (Ranged) ****

    14 vote(s)
    53.8%
  3. Pegasus **

    6 vote(s)
    23.1%
  4. Cart/Carriage/Wagon Pull **

    11 vote(s)
    42.3%
  5. Horse Sounds *

    12 vote(s)
    46.2%
  6. More & Stable Integrations (Realistic FPS Prefab, UFPS, Otti's, Opsiive TCP... etc) **

    16 vote(s)
    61.5%
Multiple votes are allowed.
  1. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    If you are using Holders that won't work, you need to set Use inventory on the Rider Combat
    upload_2020-4-5_20-55-22.png
     
  2. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,756
    i'm already using inventory. With that script, it doesn't work.
     
  3. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,756
    Ok I fixed it. Here is the problem... I instantiate the horse/rider from script. I have to do this for several reasons. The main one that I also need to instantiate from multiplayer network.

    Then I tried to set it up with the above script. It wouldn't work no matter what I tried. The reason is simple: all initialization code is done on Start/Awake on your scripts.

    What I had to do is create a public method to allows me to initialize every script (Rider, RiderCombat, MAnimal and so on).

    Then add a private bool initialized = false and

    if (initialized) return; initialized=true; inside the Initialize methods.

    Working good now.
     
    Last edited: Apr 7, 2020
    Malbers likes this.
  4. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,200
  5. chrisabranch

    chrisabranch

    Joined:
    Aug 15, 2014
    Posts:
    146
    will it work with opsive TPS 2?
     
  6. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,200
    NatureManufacture updated almost all of their assets and I thought I didn't use the Ice World asset that often yet. And since I already had HAP and all integrated from the previous video, it was just a matter of drag & drop. So here are some images :D

    rider 1.jpg
    rider 2.jpg
    rider 6.jpg
    rider 16.jpg
    rider 12.jpg
     
    zhn17 and Malbers like this.
  7. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,756
    is there a way to get the speed at what the horse is moving? I can't find any method call on the mAnimal or anywhere

    also, when i press forward and release, it takes a long time to stop. Or when i move forward and then back, it takes a long time to change direction. Is there any variable that manages that so i can speed it up? I would expect that if im moving forward and hit back, it should brake the horse pretty fast.
     
  8. Certa11n

    Certa11n

    Joined:
    Feb 5, 2020
    Posts:
    6
    So I tried to change the player from the Cowboy to a female and yea, a couple of issues occurred even though I (think) I configured everything properly as I copied the settings from the cowboy as well.
    Basically, the reins tries to fly into space as the hands doesn’t want to hold them (not using Rider Combat and it was working without it before with the cowboy), and the other issue being that I can’t mount or dismount using the inputs. I have to call DismountAnimal etc all manually

    is there anything I can do to fix this?
     
    MeadowRiders likes this.
  9. zhn17

    zhn17

    Joined:
    Jul 30, 2019
    Posts:
    52
    That looks really good! What terrain shader are you using?


    You can get the speed pretty easily from the horse's logic (MAnimal)

    var hSpeed = HorseObject.GetComponent<MAnimal>().HorizontalSpeed.ToString("F4");

    ^ That can be found in the horse's inspector too, under "MAnimal", "Debug" and then the "RB Horiz Speed" field will display the current speed.
     
  10. zhn17

    zhn17

    Joined:
    Jul 30, 2019
    Posts:
    52
    In case anyone ever experiences the same reins problem as I did, here's some code snippets which lets you configure the reins easier.

    IKReins:

    Code (CSharp):
    1. [RequireComponent(typeof(Mount))]
    2.     public class IKReins : MonoBehaviour
    3.     {
    4.         public static IKReins instance;
    5.         public Transform LeftHandRein;
    6.         public Vector3 LeftHandOffset = new Vector3(-0.125f, 0.02f, 0.015f);
    7.  
    8.         [Space]
    9.         public Transform RightHandRein;
    10.  
    11.         public Vector3 RightHandOffset = new Vector3(-0.125f, 0.02f, -0.015f);
    12.  
    13.         /// <summary>Left Rein Handle Default Local Position  </summary>
    14.         private Vector3 DefaultLeftReinPos;
    15.  
    16.         /// <summary>Right Rein Handle Default Local Position  </summary>
    17.         private Vector3 DefaultRightReinPos;
    18.  
    19.         [HideInInspector] public Transform Rider_L_Hand, Rider_R_Hand;
    20.         private Mount Montura;
    21.  
    22.         private bool freeRightHand = true;
    23.         private bool freeLeftHand = true;
    24.  
    25.         private void Awake()
    26.         {
    27.             instance = this;
    28.             Montura = GetComponent<Mount>();
    29.         }
    30.  
    31.         private void Start()
    32.         {
    33.             if (LeftHandRein && RightHandRein)
    34.             {
    35.                 DefaultLeftReinPos = LeftHandRein.localPosition;
    36.                 DefaultRightReinPos = RightHandRein.localPosition;
    37.             }
    38.             else
    39.                 Debug.LogError(
    40.                     $"Some of the Reins have not been set in the inspector (GameObject Name: {name}). Please fill all of the values.");
    41.         }
    42.  
    43.         private void OnEnable() => Montura.OnDismounted.AddListener(OnRiderDismounted);
    44.  
    45.  
    46.         private void OnDisable() => Montura.OnDismounted.RemoveListener(OnRiderDismounted);
    47.  
    48.         /// <summary>Free the Right Hand (True :The reins will not be on the Hand)</summary>
    49.         public void FreeRightHand(bool value)
    50.         {
    51.             freeRightHand = !value;
    52.             if (freeRightHand && RightHandRein) RightHandRein.localPosition = DefaultRightReinPos;
    53.         }
    54.  
    55.         /// <summary>Free the Left Hand (True :The reins will not be on the Hand)</summary>
    56.         public void FreeLeftHand(bool value)
    57.         {
    58.             freeLeftHand = !value;
    59.             if (freeLeftHand && LeftHandRein) LeftHandRein.localPosition = DefaultLeftReinPos;
    60.         }
    61.  
    62.         private void OnRiderDismounted()
    63.         {
    64.             Rider_L_Hand = null;
    65.             Rider_R_Hand = null;
    66.  
    67.             LeftHandRein.localPosition = DefaultLeftReinPos;
    68.             RightHandRein.localPosition = DefaultRightReinPos;
    69.         }
    70.  
    71.  
    72.         private void LateUpdate()
    73.         {
    74.             if (!Rider_L_Hand || !Rider_R_Hand) return;
    75.             if (Montura.Rider && Montura.Rider.IsRiding)
    76.             {
    77.                 var New_L_ReinPos = Rider_L_Hand.TransformPoint(LeftHandOffset);
    78.                 var New_R_ReinPos = Rider_R_Hand.TransformPoint(RightHandOffset);
    79.  
    80.                 if (!freeLeftHand && !freeRightHand) //When Both hands are free
    81.                 {
    82.                     LeftHandRein.localPosition = DefaultLeftReinPos;
    83.                     RightHandRein.localPosition = DefaultRightReinPos;
    84.                     return;
    85.                 }
    86.  
    87.                 if (freeLeftHand) LeftHandRein.position = New_L_ReinPos; //Put it in the middle o the left hand
    88.                 else if (freeRightHand)
    89.                     LeftHandRein.position =
    90.                         New_R_ReinPos; //if the right hand is holding a weapon put the right rein to the Right hand
    91.  
    92.                 if (freeRightHand) RightHandRein.position = New_R_ReinPos; //Put it in the middle o the RIGHT hand
    93.                 else if (freeLeftHand)
    94.                     RightHandRein.position =
    95.                         New_L_ReinPos; //if the right hand is holding a weapon put the right rein to the Left hand
    96.             }
    97.             else
    98.             {
    99.                 LeftHandRein.localPosition = DefaultLeftReinPos;
    100.                 RightHandRein.localPosition = DefaultRightReinPos;
    101.             }
    102.         }
    103.     }
    ReinsConnect:

    Code (CSharp):
    1. /// <summary>
    2.     /// Alternative to Malbers' way of positioning the reins.
    3.     /// <para>For characters who's hand glitches with the reins, use script attached to that character and configure it to your liking.</para>
    4.     /// <para>-- ALPHA AND THEREFORE IT HAS A LOT OF ISSUES! --</para>
    5.     /// <para>Created by Certain. on 2020/04/10, 00:16.</para>
    6.     /// </summary>
    7.     public class ReinsConnect : MonoBehaviour
    8.     {
    9.         #region Structures
    10.         /// <summary>
    11.         /// Empty structures are still being displayed, but only with their variable name so you can easily use that to display tooltip messages w/o a custom editor.
    12.         /// </summary>
    13.         [Serializable] public struct Empty { }
    14.  
    15.         /// <summary>
    16.         /// The variables.
    17.         /// <para>Structures and Garbage Collections goes better together when there's not a lot of variables.</para>
    18.         /// </summary>
    19.         [Serializable] public struct Variables
    20.         {
    21.             [Tooltip("The hands (max 2). Please check the 'Hover Over Me' tooltip before using this.")]
    22.             public Transform[] hands;
    23.  
    24.             [Tooltip("Rein offsets.")] public Vector3 offsetRight, offsetLeft;
    25.         }
    26.         #endregion
    27.         #region Variables
    28.         #region Empty
    29.         [Tooltip(
    30.             "The hands have to be only 2 and in this specific order:\n0: Right Hand\n1: Left Hand\nAnd they have to be positioned correctly.\nThis is not perfect as it's in Alpha and will be improved later on.")]
    31.         public Empty hoverOverMe;
    32.         #endregion
    33.         #region Editor
    34.         public Variables variables;
    35.         #endregion
    36.         #region Class
    37.         /// <summary>
    38.         /// Player animator.
    39.         /// </summary>
    40.         private Animator animator;
    41.  
    42.         /// <summary>
    43.         /// Hand bone transform.
    44.         /// </summary>
    45.         private Transform rightHand, leftHand;
    46.         #endregion
    47.         #endregion
    48.  
    49.         /// <summary>
    50.         /// Initiate all private variables, verify hands count, etc.
    51.         /// </summary>
    52.         private void Start()
    53.         {
    54.             var hCount = variables.hands.Length;
    55.             if (hCount > 2 || hCount < 2) return;
    56.             animator = GetComponent<Animator>();
    57.             rightHand = animator.GetBoneTransform(HumanBodyBones.RightHand);
    58.             leftHand = animator.GetBoneTransform(HumanBodyBones.LeftHand);
    59.         }
    60.  
    61.         /// <summary>
    62.         /// Physics update fits this the most.
    63.         /// </summary>
    64.         private void FixedUpdate()
    65.         {
    66.             Transform rR = IKReins.instance.RightHandRein, lR = IKReins.instance.LeftHandRein;
    67.             Transform rH = rightHand, lH = leftHand;
    68.             variables.hands[0].position = rH.position + rH.rotation * variables.offsetRight;
    69.             variables.hands[1].position = lH.position + lH.rotation * variables.offsetLeft;
    70.             rR.position = variables.hands[0].position;
    71.             lR.position = variables.hands[1].position;
    72.         }
    73.     }
    To use it, apply ReinsConnect to your player, create 2 empty game objects (or cubes, doesn't matter), reference the game objects according to hoverOverMe's message (make sure your horse has a IKReins component attached and the game objects positioned correctly, mess around with it).
    You have a offset Vector which you can also play around with.
    No, this is not perfect and should certainly not be considered a solid fix as it needs a lot of tweaking, but it works.
     
    Malbers and dsilverthorn like this.
  11. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,756
    What about getting the velocity?
    What I'm trying to do is send the data over the network so I can clone one horse remotely. So I need to know transfer over the velocity (direction it is moving and at what rate) so I draw it on the other side.
     
    Malbers likes this.
  12. dsilverthorn

    dsilverthorn

    Joined:
    May 14, 2017
    Posts:
    835
    @Rowlan How do you get the wagon ruts?
    That looks awesome!
    I'm making a desert canyon and this is what is missing.
     
    Malbers likes this.
  13. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,200
    It's from the upcoming Microsplat module Trax, I had the pleasure to be allowed in the beta. It's been submitted afaik, when it will be available depends on Unity. It does give detail and atmosphere. I should add sand and dust particles as well to get an even more intense effect.
     
    dsilverthorn and Malbers like this.
  14. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    Here's the Speed of that the horse is moving:
    upload_2020-4-11_13-17-10.png

    And is stored on float Animal.HorizontalSpeed
     
  15. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    I have updated AC and HAP :)


    (AC) 1.1.5 (HAP 4.08) - 2020 Apr 9
    • Added: Fly State Land Time.. to avoid immediately landing after the take off.
    • Fixed: When playing Modes the Random Value was enable, it caused Random Idles to play on the Lower Layer
    • Fixed: Small fixes to the Mode Inspector
    • Added: Value Property to Bool, Int and Float Listener Component
    • Added: CheckVarListener Decision to the Brain AI
    • Added HelpBox Attribute
    • Added: On Enter, On Exit Event to the Attack Triggers
    • Fixed: UpdateDirectionSpeed was false instead of true on Start (It caused Zero movement on Non Root Motion Character). IMPORTANT
    • Added: AND AI Biain Decisions
    • Added: OR AI Brain Decisions
    • Fixed: AI Animal Control Must wait one frame, and then set the next Target/position to go to
    • Added: Look Decision can Search for a Specific Zone with Index
    • Fixed: Play Mode Task (Modes can Interrupt other modes, E.g Attack can interrupt being hitted)
     
    zhn17 and Rowlan like this.
  16. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    This are new asset we are working on (separated from HAP) since is not only mine (is a shared asset).. but it will be fully compatible with HAP and AC and all my assets
    02 - Copy.png Ice Undead2.jpg Meat Undead.jpg Toxic.jpg
     
    Kaen_SG, BackwoodsGaming and zhn17 like this.
  17. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,200
    The first one definitely belongs to Scorpion from Mortal Kombat, the Hell version. Second one Sub Zero :D

    Very awesome!
     
    hopeful and Malbers like this.
  18. zhn17

    zhn17

    Joined:
    Jul 30, 2019
    Posts:
    52
    Snagging that asset whenever it's out
    Hopefully there will be a documentation on how to implement it and works with my modified HAP version (optimized and gained about 10FPS from some stuff, removed old stuff, cleaned the code etc)
     
  19. coolguy_platinum

    coolguy_platinum

    Joined:
    Mar 4, 2019
    Posts:
    15
    Character Shakes Constantly After Unmounting Malbers Horses.
    Seem like it just happen out of nowhere. Anyone know what this could be?


    NullReferenceException: Object reference not set to an instance of an object
    MalbersAnimations.HAP.MRider.ToggleComponents (System.Boolean enabled) (at Assets/Malbers Animations/Common/Scripts/Riding System/Rider/MRider.cs:740)
    MalbersAnimations.HAP.MRider.Start_Mounting () (at Assets/Malbers Animations/Common/Scripts/Riding System/Rider/MRider.cs:440)
    MalbersAnimations.HAP.MountBehavior.OnStateEnter (UnityEngine.Animator animator, UnityEngine.AnimatorStateInfo stateInfo, System.Int32 layerIndex) (at Assets/Malbers Animations/Common/Scripts/Riding System/Rider/MountBehavior.cs:42)
     
  20. Certa11n

    Certa11n

    Joined:
    Feb 5, 2020
    Posts:
    6
    Happened for me yesterday and just restarting unity fixed it
     
  21. dsilverthorn

    dsilverthorn

    Joined:
    May 14, 2017
    Posts:
    835
    Thanks @Rowlan!
    I searched for trax bur couldn't find anything. Now I know why. Very nice, I'll be looking for that one.:)
     
    zhn17 and Rowlan like this.
  22. hoseinakbo

    hoseinakbo

    Joined:
    Apr 8, 2015
    Posts:
    9
    @Malbers Hi there! Thanks for your awesome asset pack!!! I'm just stuck with one thing on mobile, I'd like to set the jump input to swipe up but I can't figure out where I can detect swipe. Can you help me with this?
     
    Malbers likes this.
  23. zhn17

    zhn17

    Joined:
    Jul 30, 2019
    Posts:
    52
    The swipe up code I don't know, but here's the code for triggering Jump:
    (You want to reference the horse's logic [MAnimal] and avoid all GetComponent calls that are repeated.)
    Code (CSharp):
    1. HorseObject.GetComponent<MAnimal>().State_TryActivate(2);
     
    Malbers and hoseinakbo like this.
  24. hoseinakbo

    hoseinakbo

    Joined:
    Apr 8, 2015
    Posts:
    9
    Thanks @zhn17 but my problem is the input part. I don't know how to detect swipe in this system
     
  25. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    Like @zhn17 Said... sadly there's no code for swiping on any direction

    but the correct way to do it is : animal.State_TryActivate(2)

    what you can do is to use any swipe logic you find out there on the Store .. and when is executed then call that method
     
    hoseinakbo likes this.
  26. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    It seems the ToggleComponent method is associated with the Disabled List on the Rider:
    Make sure you don't have any empty element on the list:
    upload_2020-4-13_15-29-47.png
     
  27. zhn17

    zhn17

    Joined:
    Jul 30, 2019
    Posts:
    52
    @Malbers I'm trying to make some animations use the horse blink blend shape in it's skinned mesh renderer but just noticed that something is constantly setting it's value to 0, and it's not the animator or Blink Eyes script. Do you have any idea what it is?
     
    Malbers likes this.
  28. zhn17

    zhn17

    Joined:
    Jul 30, 2019
    Posts:
    52
    Nevermind I'm blind
    I checked the HorseBody again and noticed that a sep. animator component was collapsed and I didn't see it before, disabling it made so I can change the blink value again.
     
    Malbers likes this.
  29. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    Toxic Undead Horse! (green Skin)
    08.jpg
     
  30. zhn17

    zhn17

    Joined:
    Jul 30, 2019
    Posts:
    52
    That looks amazing!
    Will they come with mount support out of the box?
     
  31. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    Yes they will!!
     
    BackwoodsGaming likes this.
  32. gearedgeek

    gearedgeek

    Joined:
    Jun 19, 2015
    Posts:
    236
    Any updates with integration with Opsive newest character controller?
     
  33. hoseinakbo

    hoseinakbo

    Joined:
    Apr 8, 2015
    Posts:
    9
    Awesome Thanks!!
     
  34. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,756
    I added the horse and made it multiplayer. Took me a while to figure it out but seems to be working fine now.
    You can download the game for free on www.dogfightelite.com (mobile and desktop version).



    The only remaining issue is the aiming. I don't know why it's aiming like that. The arm all extended around the sholder that way when I turn around. I played with the offset values but they don't fix it.
     
    transat and zhn17 like this.
  35. qazik123

    qazik123

    Joined:
    Jan 30, 2020
    Posts:
    6
    Hello,
    first - this is great asset! Secondly - I would like to use it in a game from medieval, do you plan to create an knight charge animation (with a lance)?
     
  36. mbussidk

    mbussidk

    Joined:
    May 9, 2017
    Posts:
    67
    Hi @Malbers
    I've done some changes to the Animal Controller and the HAP scripts to allow Invector characters to deal damage to animals and vice versa. How can I send you my modifications to add to your code base?
     
  37. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    Thats awesome ... Please write me to malbers.shark87@gmail.com
     
  38. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
  39. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    Try using the IK version for the Gun Ability instead of the FK
    upload_2020-4-16_12-0-45.png
     
  40. zhn17

    zhn17

    Joined:
    Jul 30, 2019
    Posts:
    52
    Does players who spawn in see you riding on the horse or is it glitched?
    If it works as intended, what did you do to sync just that? As last time I joined a server while the other client was mounted, the scale and everything freaked out.
     
  41. zhn17

    zhn17

    Joined:
    Jul 30, 2019
    Posts:
    52
    So after some months I decided to get some more Multiplayer stuff synced, here's Horizontal and Vertical movement.
    And I am aware that the jump looks like a wheel chair bound dolphin right now
     
  42. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,756
    yes they see me. I wrote my own system. Download the game you can check it easily, it's free to play.
     
  43. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,756
    is there a way to slow down the noises of the horse? it keeps making noises and it's becoming annoying after a while. I see no way to control the amount of times it calls each sound or how often
     
    dsilverthorn likes this.
  44. zhn17

    zhn17

    Joined:
    Jul 30, 2019
    Posts:
    52
    Check the animator for the sounds, you can make a Coroutine that plays a random sound every (x) amount of seconds.

    Mind sharing parts of it? Gotten basic stuff working but jumping etc is a literal pain
     
    transat and dsilverthorn like this.
  45. gearedgeek

    gearedgeek

    Joined:
    Jun 19, 2015
    Posts:
    236
  46. tgamorris76

    tgamorris76

    Joined:
    Apr 24, 2013
    Posts:
    292
    Hi, just got this in the sale, is there integration for game creator(yet)?
     
  47. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    Yes I have test it. Practically what it does is to disable completely the UCC Controller which that is what I did on the First integration with HAP.
    (The recommended option is to put to sleep UCC controller, not disable it completely)
    No is not done yet :(
     
    gearedgeek likes this.
  48. tgamorris76

    tgamorris76

    Joined:
    Apr 24, 2013
    Posts:
    292
    Ok thank you, any idea when it will be done?
     
  49. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    I talked to Justin so in may we start again working on the integration for UCC
     
  50. transat

    transat

    Joined:
    May 5, 2018
    Posts:
    779
    @Malbers Unity’s new input system is in its last preview before its official release. Are there plans for an official integration?