Search Unity

Malbers Animals-Creatures

Discussion in 'Assets and Asset Store' started by Malbers, Nov 12, 2016.

  1. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    To make any animal mobile ready you need to add the Event listeners here:
    upload_2020-9-4_11-39-23.png

    this will create the Listener Component that will connect the Mobile UI Canvas and all its buttons and axis with any animal:
    upload_2020-9-4_11-40-19.png


    Make sure the Malbers Input Component is disabled, since is used for Keyboard and GamePad Inputs.
    Also Disable on the FreeLookCamera the Vertical and Horizontal Inputs:
    upload_2020-9-4_11-49-19.png

    And that's it :)

    Edit: I Found this haha:

     
    Last edited: Sep 4, 2020
  2. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    and
    Yes the update solves a lot of issues, but please be patience :)
    I'm wrapping up everything to release it as soon as I can without any major issues that may escape my sight ^^.
    I'm checking every scene of every asset to make sure all is working as expected.
     
  3. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    Hi my friend!
    Here's the hidden parameter:
    upload_2020-9-4_11-56-37.png

    Hope this helps ( ̄︶ ̄)↗ 
     
    HeyBishop likes this.
  4. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    The Cougar uses a Color Chart kind of Texture, which uses overlapping UVs..
    you can change the colors to create more variations in photoshop or any Image editor soft.
    upload_2020-9-4_12-12-12.png

    But if you want to paint textures on the cougar (or any poly art animal)
    you will need to import it into any 3D Software and change the UV from Overlapping to Non Overlapping (Unwrapped UV)
     
  5. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    The animals Uses the
    Move(Vector3 Direction)
    to move using a Direction...

    but with Raw Inputs like Vertical (1/-1) Horizontal (1/-1) from inputs the Animal needs to convert them to a Direction..

    Instead you can use
    animal.SetInputAxis(Vector3 Axis)

    Where X - Horizontal Y - UpDown and Z - Vertical
     
  6. danteswap

    danteswap

    Joined:
    Oct 27, 2013
    Posts:
    164
    Ok But How Do I Set Or Access any reference to the M_animal Sctipt Or Animal Controller To Use animal.SetInputAxis.
    I mean int my custom code i need to reference the m animal script before accessing the animal.SetInputAxis Function
     
  7. danteswap

    danteswap

    Joined:
    Oct 27, 2013
    Posts:
    164
    I am Also facing 1 more problem while setting up a chicken it either stucks in the ground after the jump and loop into jump state forever .
     
  8. HeyBishop

    HeyBishop

    Joined:
    Jun 22, 2017
    Posts:
    238
    Splendid! Thank you friend!
     
  9. danteswap

    danteswap

    Joined:
    Oct 27, 2013
    Posts:
    164
    Hello There I was Successfull in implementing this
    Code (CSharp):
    1. MalbersAnimations.Controller.MAnimal.MainAnimal.SetInputAxis(new Vector3(ETCInput.GetAxis("Horizontal"),0, ETCInput.GetAxis("Vertical")));
    2.         MalbersAnimations.Controller.MAnimal.MainAnimal.Sprint = ETCInput.GetButton("Sprint");
    But I dont know how to add custom buttons code for Camera Input, Jump , Attack And All Other Inputs That we are using in malbers Input Script
     
    Last edited: Sep 4, 2020
    Malbers likes this.
  10. tahir_ali

    tahir_ali

    Joined:
    Jan 6, 2018
    Posts:
    119
    Share AC, LDT and LDS with me. May be I can help you debug issues.
     
    Malbers likes this.
  11. tahir_ali

    tahir_ali

    Joined:
    Jan 6, 2018
    Posts:
    119
    I have few suggestions for you about AC. I think you should make add on for your AC. Like HAP is good. I think it should be Add on to base AC and price is way to high as current price There are other possibilities like make Spiderman swing and wall climbing/running. Then other add on like superman flying/gliding(like just cause 3 and 4). And best thing these add-ons will include your awesome animations that will make them high potential add-ons. Possibilities are infinite.
     
    Malbers likes this.
  12. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    The easiest way is to use the Event and Event Listener. That way you avoid Dependencies of any scripts on the scene:
    For example on the Joystick Included, I use the Unity Events to Sent the Axis Horizontal and Vertical like this:
    upload_2020-9-5_15-30-13.png

    That Event will then be listen by all the game Objects that has the EventListener Attached to it..
    In my assets all the animals have this event set.. here:
    upload_2020-9-5_15-31-54.png

    and just like that, All the Animals with the MEventListerner Component Enabled will get the value from the event and pass it to its connection... which in this case is Animal.SetInputAxis(Vector2).

    Noticed that Each Event can have more than one value type (void,Bool,Float,Int,String,Game Object, Transform, Component, Vector2 and 3)

    So you need to make sure the connection is set on the Right Response..
     
  13. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    For Connecting the States you can use how I did it on the same mobile buttons too :)
    You just need to use Invoke(bool) on the Events to activate the States:
    E.g. the Jump Button:
    upload_2020-9-5_15-59-38.png
     
  14. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    I'll wrote you via PM :) ...
     
  15. mathiagr

    mathiagr

    Joined:
    Feb 16, 2016
    Posts:
    19
    Hi, I noticed a bug with the boar as it grows from baby to adult (the front legs go instantly to adult size):
     
    Malbers likes this.
  16. danteswap

    danteswap

    Joined:
    Oct 27, 2013
    Posts:
    164
    Thank you So Much For The Help It Worked , Now I would like to Create Auto sprint without the sprint button , i Mean if user presses the joystick just half way then between this animal should walk and if player drags the joystick all the way up then animal should start sprinting automatically without pressing the sprint button for easy controls on mobile
     
    Last edited: Sep 7, 2020
  17. VagabondOfHell

    VagabondOfHell

    Joined:
    Sep 17, 2013
    Posts:
    15
    Hi @Malbers

    I've been using Irval the Wyvern with the Animal Controller and am absolutely loving it. Fantastic work.

    I'm writing you here to see if you take animation requests and if so, would you be willing to add in a strafe-like movement for the dragons while flying forward. Similar to the way a drone flies sideways. The dragon would roll a bit to the left or right in order to get a translation on the respective side. Right now it seems that the dragon is only capable of turning left or right while flying.

    Also, is there a way to allow a transition from Jump to Fly? I've tried changing the order of the Jump and Fly states but the transition is only allowed about halfway through the in-air animations. How could I allow the transition to flight mid-jump?

    Thank you, and fantastic work on your assets.
     
    Last edited: Sep 7, 2020
    Malbers likes this.
  18. tieum67

    tieum67

    Joined:
    Mar 7, 2017
    Posts:
    61
    Sorry, my question wasn't precise enough... Basically, i wanted to set up the raven for an enless runner. So, one script is handling the left/rgith strafe. It was very easy finally, as there is the possibility to unchek the horizontal movement in your controller ;)
     
  19. arminiuspp

    arminiuspp

    Joined:
    Jun 15, 2020
    Posts:
    54
    Hi, so I want my AI cougars to just wander around but I don't know how to set that up. I have placed them with an AI from the Cougar pack but they're just standing.
     
  20. wood333

    wood333

    Joined:
    May 9, 2015
    Posts:
    851
    That's the easiest thing to do. Follow the ai setup video.
     
  21. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    THank you for reporting this!!
    Here's the fix!
     

    Attached Files:

  22. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    You can try the Smooth Vertical Option ,used for Joystick Pressure
    https://forum.unity.com/threads/malbers-animals-creatures.440812/page-32#post-6278819

    And also set the Default Speed of the animal to the Maximum:
    upload_2020-9-9_11-49-58.png
     
  23. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    Thank you for using the Wyvern!!!
    Yes I do have those animations on my to do list!
    After the update is Live and I finish the Integrations I have on queue I will be making the new set of Animations for all the assets
    chrome_hH3e6E0tmO.png
    The Fly State needs to be on top of the Jump State in order to be Called..
    But it won't be active until the Jump state is mid state
    because internally the Jump is set to Persistent, until the Jump Time is passed on the Jump State.
    After that new states can be activated.
     
    VagabondOfHell likes this.
  24. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    Yes you need to create waypoints on the scene and connect each other... and assign a target to the AI Animal:
    upload_2020-9-9_12-22-20.png
     
  25. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    Yes!
    For an endless runner:
    Enable this Option:
    upload_2020-9-9_12-24-30.png

    and For locking the Horizontal Movement:
    This one:
    upload_2020-9-9_12-24-56.png

    Also if you are going to use it for an infinite Runner Disable the Camera Input Option.
     
  26. Jshh

    Jshh

    Joined:
    Sep 14, 2019
    Posts:
    38
    Hey Malbers, hope you're well.

    Does the MAnimal system support NavMesh Link components for jumping across gaps?

    I've been able to get it working with OffMesh Links, including those generated automatically by Unity, but NavMesh Links don't seem to trigger the jump state (so the animal falls into the gap).

    The reason I'd like to use NavMesh Links is that I can generate them automatically (with this open source generator), between different elevations, whilst OffMesh Links need to be placed manually (you can autogenerate them but not between different elevations- the surfaces need to be at the same height otherwise no links are created).

    Would appreciate your help!
     
  27. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    Yes!

    if the OffMesh link is set to Jump the Animal will automatically apply the Jump State:
     
    webgrapx and Jshh like this.
  28. Jshh

    Jshh

    Joined:
    Sep 14, 2019
    Posts:
    38
    Thanks Malbers, yes OffMesh Links work great, but I'm trying to use NavMesh Link components (which are a different but similar thing).

    This works (whether manually placed or autogenerated):

    upload_2020-9-11_2-2-46.png

    But this doesn't:

    upload_2020-9-11_2-2-11.png

    Maybe I'm missing something about how they're supposed to work...
     
    Malbers likes this.
  29. Jshh

    Jshh

    Joined:
    Sep 14, 2019
    Posts:
    38
    Also when I use the NavMeshLink component I get a null reference exception- maybe that's related...

    NullReferenceException: Object reference not set to an instance of an object
    MalbersAnimations.Controller.MAnimalAIControl.CheckOffMeshLinks () (at Assets/Assets/Malbers Animations/Common/Scripts/Animal Controller/MAnimalAIControl.cs:534)
    MalbersAnimations.Controller.MAnimalAIControl.UpdateAgent () (at Assets/Assets/Malbers Animations/Common/Scripts/Animal Controller/MAnimalAIControl.cs:289)
    MalbersAnimations.Controller.MAnimalAIControl.Updating () (at Assets/Assets/Malbers Animations/Common/Scripts/Animal Controller/MAnimalAIControl.cs:239)
    MalbersAnimations.Controller.MAnimalAIControl.Update () (at Assets/Assets/Malbers Animations/Common/Scripts/Animal Controller/MAnimalAIControl.cs:199)
     
  30. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    Oh I havent try those ... thanks for reporting it

    BTW where do I find that component ? which package do I install?
     
  31. Jshh

    Jshh

    Joined:
    Sep 14, 2019
    Posts:
    38
    They're still in beta, but there are some powerful features. You can install the components and see some demos at the unity GitHub - there are instructions on this page :)

    I'm very interested to hear if there's a simple fix!
     
    mandisaw and Malbers like this.
  32. manurocker95

    manurocker95

    Joined:
    Jun 14, 2016
    Posts:
    210
    Oh, I didn't find the update shaders option in the toolbar. Perfect! Any ETA for that update? ^^ I'm waiting for Irval to be on sales to get it. I think I have every other package xD
     
  33. christougher

    christougher

    Joined:
    Mar 6, 2015
    Posts:
    558
    Malbers and Jshh like this.
  34. Jshh

    Jshh

    Joined:
    Sep 14, 2019
    Posts:
    38
    @christougher thanks! That did look great. Actually I had already tried using it- but I got an error I wasn't able to fix; the Editor/NavMeshEditor_TBS script (maybe not the exact filenames) wasn't able to find the NavMesh_TBS class (namespace / reference issue?).

    Maybe a version issue? I'm using 2019.4.3.

    I should ask about the error on your/eDimitry's thread, but found another solution (that repo I mentioned above).

    Anyway even if I could generate NavMesh Links, the animal controller ignores them at present :)
     
    Malbers likes this.
  35. Jshh

    Jshh

    Joined:
    Sep 14, 2019
    Posts:
    38
    @Malbers I did a little more digging on the subject...

    I found out from the Unity GitHub that there are a couple of differences in how NavMesh and OffMesh Links work, but there are workarounds, like using
    var link = (UnityEngine.AI.NavMeshLink)Agent.navMeshOwner
    instead of
    OffMeshLinkData offData = agent.nextOffMeshLinkData;


    So it's possible to handle both, with a few additional tweaks. I started hashing out some (very rough) adaptations in MAnimalAIControl.cs, in the CheckOffMeshLinks() method, to get the agent to go into jump state when touching a NavMesh Link.

    Code (CSharp):
    1.        
    2. protected virtual void CheckOffMeshLinks()
    3.         {
    4.             if (Agent.isOnOffMeshLink /*&& !EnterOFFMESH*/)                         //Check if the Agent is on a OFF MESH LINK
    5.             {
    6.                 var link = (UnityEngine.AI.NavMeshLink)Agent.navMeshOwner;
    7.                 if (link) // if using NavMesh Components Bundle
    8.                 {
    9.                     animal.State_Activate(StateEnum.Jump);
    10.                     if (link.area == 2) // Meaning "Jump"
    11.                     {
    12.                         var DistanceEnd = (transform.position - link.endPoint).sqrMagnitude;
    13.                         var DistanceStart = (transform.position - link.startPoint).sqrMagnitude;
    14.  
    15.                         var NearLinkPoint = DistanceEnd < DistanceStart ? link.endPoint : link.startPoint;
    16.                         var FarLinkPoint = DistanceEnd > DistanceStart ? link.endPoint : link.startPoint;
    17.                         Quaternion LinkAngle = Quaternion.FromToRotation(NearLinkPoint, FarLinkPoint);
    18.  
    19.                         StartCoroutine(MTools.AlignTransform_Rotation(transform, LinkAngle, 0.15f));         //Aligning the Animal to the Link Position
    20.                         animal.State_Activate(StateEnum.Jump); //2 is Jump State
    21.                     }
    22.                 }
    23.                 else { // using OffMeshLink NavMesh system
    24.  
    25. // .... etc - rest of the method untouched ...
    26.  
    27.  
    ...And though it needs cleaning up and debugging, it started kinda working.

    However, I then hit another issue, which is that after doing the jump, the AnimalBrain seemed to stall. Maybe I'm missing a ResumeAgent() call somewhere?

    Incidentally I think this was the issue I had before, about which we exchanged a few emails. I now know the reason is that I was using the new (well, newer) NavMesh Components bundle, not the one that ships inside Unity.

    So can you tell me how you resume the AnimalBrain after a state change (eg. Jump) at the moment? I reckon if I understood that a bit better I could get it all going with both nav systems.
     
    mandisaw, Malbers and christougher like this.
  36. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    Awesome!!
    I'm still wrapping up all the assets with the new AC update so all of them are released at the same time ;)
    I had to make some updates on every prefab and Animator Controllers of each asset.. to be compatible with the new AC.

    Bare with me so I can then.. jump into the new Navmesh system.. But I think you will solve it first :) :)

    AC and HAP are already on pending review... They should be up next week... ^^
     
    Jshh likes this.
  37. HeyBishop

    HeyBishop

    Joined:
    Jun 22, 2017
    Posts:
    238
    I'm attempting to use your Animal Controller on a bipedal human. I'm using a Synty Studios character, with animations from Mixamo.
    I've followed the steps of your tutorial videos very carefully up to Tutorial 2 with the locomotion. When walking with the character, she snaps back to her original position. To best explain, I recorded a sample. In the sample, after I click play -I walk directly down (toward the fixed camera), then I try walking right. Neither work. Any ideas?

     
  38. Jshh

    Jshh

    Joined:
    Sep 14, 2019
    Posts:
    38
    @Malbers that's great to hear! Look forward to seeing the new update :)
     
    Malbers likes this.
  39. christougher

    christougher

    Joined:
    Mar 6, 2015
    Posts:
    558
    This looks like classic root motion issues. The animations need to have root motion enabled in their import settings
     
    mandisaw likes this.
  40. christougher

    christougher

    Joined:
    Mar 6, 2015
    Posts:
    558
    @Jshh I've got the NavMeshLinkGenerator working in 2019 just fine. Not sure what error your getting but let me know if I can help. I've also tried replacing the Navmeshcomponents in the dropbox download with the official Unity versions and it's still working great. I'm wondering if you deleted the whole navmeshcomponents scripts folder in the project and replaced them with the unity ones, that would delete one editor script that is needed. Sorry to hijack Malber's thread, But if I may say having support for the Navmeshlink system would definitely be great!

    edit: also working with Unity 2020
     
    Jshh and Malbers like this.
  41. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    That's the Avatar :)
    You need to have the same avatar from your mesh on your Animator. If its empty then it causes that issue upload_2020-9-12_12-51-30.png
     
  42. danteswap

    danteswap

    Joined:
    Oct 27, 2013
    Posts:
    164
    Hi thanks for the solution i will try it soon , I have 1 More Problem so for now lets say an animal is wandering and our player is going closer to it now what i want to achieve is that if the enemy animal is in a certain radius from player like say distance between player and animal is 20 so now if the player press the attack button then our player animal should run towards the enemy animal and when it is in attack range then it should start attacking the enemy animal untill the enemy is dead or player press any other button. How to achieve that using animal controller i want to automate the process of attacking and moving closer to attack for the sack of easy gameplay on mobile device where player dont have to worry about anything else but controlling the animal pressing attack button to attack and joystick for fleeing from there
     
  43. HeyBishop

    HeyBishop

    Joined:
    Jun 22, 2017
    Posts:
    238
    Thank you both. Turns out it was the root motion issue. I had to uncheck Root Transform Rotation/Position and I got it working.


    I moved forward with the tutorial. Got the locomotion and falling working fine. When I attempted to add a Sprint state, I got the following error in the console:

    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. MalbersAnimations.Controller.Fall.DebugState () (at Assets/Malbers Animations/Common/Scripts/Animal Controller/States/Fall.cs:317)
    3. MalbersAnimations.Controller.MAnimal.OnDrawGizmos () (at Assets/Malbers Animations/Common/Scripts/Animal Controller/MAnimal.cs:229)
    4. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
    After I removed the the Sprint state error persisted. After I restarted Unity, the error was gone.
    I then decided to skip the Sprint state, and try adding the Jump state as per the tutorial and... the error returned.

    I cannot figure out what object reference is missing.

    I'm using Unity 2019.3.14f1 by the way.
     
  44. HeyBishop

    HeyBishop

    Joined:
    Jun 22, 2017
    Posts:
    238
    Another issue...
    The character orients its entire body to the ground, not just the feet like your animals. Is there something I can do about this? (By the way, I'm using Unity's Standard Asset Lowman animations)



    EDIT: I made it better! I needed to add a Chest pivot point. The feet aren't perfectly flat with the ground, but I think that's normal. You just don't notice it very much when it's a quadruped with paws.
     
    Last edited: Sep 14, 2020
  45. Jshh

    Jshh

    Joined:
    Sep 14, 2019
    Posts:
    38
    @christougher I'll take you up on that for sure, thank you! Allow me to try it in a clean project to ensure I haven't done something stupid. I'll reply in that other thread later if there are still issues :)
     
  46. EntertainmentEnterprise

    EntertainmentEnterprise

    Joined:
    Aug 22, 2018
    Posts:
    18
    I am having a huge issue with Dismember. Cs throwing errors about MaterialChanger not containing a definition for SetMaterial or materialList.... Please help!
     
  47. tahir_ali

    tahir_ali

    Joined:
    Jan 6, 2018
    Posts:
    119
    Oh man its already mid of next month and still waiting for update.
    :(:(:(:(
     
  48. Kemp-Sparky

    Kemp-Sparky

    Joined:
    Jul 7, 2013
    Posts:
    72
    It can take a long time for submissions to get approved by the Asset Store.
     
    tahir_ali likes this.
  49. puddl3jump3r

    puddl3jump3r

    Joined:
    Jan 31, 2019
    Posts:
    1
    I'm learning and really new at multiplayer. Just trying to build a small Lan game for my kids. Has anyone made a small tutorial they can link on how to setup Malbers for mirror. I keep getting both prefabs moving on both machines. I need to know which scripts to change to NetworkBehavior and where to put the isLocalPlayer. I just need a bit of direction.
     
    Malbers likes this.
  50. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    Hey guys I'm back!

    Yes ! that was the way with just a Chest Pivot, the Animal Controller works for humanoids.
    ... (now with a bit of IK and you should be done :)
    That is a feature for the future ... ;)

    Yes... Hopefully this Monday will be the day :) :)
    Remember now due to Covid all the process get a bit delayed.


    I'm still Updating all the prefabs of all the asset to the new Update which is taking a longer time than I expected.