Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

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
    Hi there! I wasn't available this weekend, but I'm back!
    For making any creature/animal mountable you will need first to use the Animal Controller with them..
    You can follow the Basic tutorials here:


    After you convert them to AC you can use this tutorial: (is a Bit outdated but the bases are the same)
     
    Last edited: Nov 30, 2020
  2. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    It is recommended using the Zones to activate the Actions like sleep, Howl.. etc

    But yes you definitely use timeline to do any animation..
    Please check the Timeline sample scene on the Animal Controller
     
  3. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    Awesome! I have added your modification for the next update :)
     
  4. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    You can speed up the animations on the Animator: on each Jump Animation set.

    upload_2020-11-30_11-40-55.png


    The air control is controlled by the Jump and Fall parameters.
    Fall State:
    upload_2020-11-30_11-43-3.png
    Jump State:
    upload_2020-11-30_11-44-8.png

    The video is not showing... can you try and publishing it again.. you can use https://streamable.com/
     
  5. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    Yes the Rider by default needs to be parented and/or moved to the Mount Point, and not having a clean Root with no strange rotations on your character will cause unwanted behaviours.
    Try having the Rider component on the root of your Character. or you can change the root reference on the Rider component to your Root Game Object here:
    upload_2020-11-30_11-53-49.png
     
  6. MasonWheeler

    MasonWheeler

    Joined:
    Apr 2, 2016
    Posts:
    210
    The strange rotations aren't on the character; they're on the mount. It's as if the dragon were modeled vertically, then the final product rotated 270 degrees to give it a proper quadruped stance.
     
    Malbers likes this.
  7. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    Then that is an easy fix, try changing the rotation of the Mount points
     
  8. RemusRain

    RemusRain

    Joined:
    Mar 9, 2019
    Posts:
    15

    Thanks for the help! here is the video again:


    As you can see, I'm landing on the ledge and the raccoon is floating above the ground and not recognizing that he is actually not grounded. Is that because I increased the size of the RaycastRadius in MAnimal? See screenshots:
     

    Attached Files:

    • a.png
      a.png
      File size:
      42.6 KB
      Views:
      281
    • b.png
      b.png
      File size:
      32.3 KB
      Views:
      275
    • c.png
      c.png
      File size:
      46.7 KB
      Views:
      282
    • d.png
      d.png
      File size:
      48.3 KB
      Views:
      280
  9. Skighfyre

    Skighfyre

    Joined:
    Dec 2, 2019
    Posts:
    2
    Does anyone have a quick reference on how to import malbers dragons with the HAP pack?
    i keep getting tons of errors of the files already containing definitions. which i get it, but i want to use the mounting system to make a mountable dragon for my game.
     
  10. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    Yes that should be one of the Main issues..

    See, the Jump State, in order to work well it needs to have set properly the Minimum Jump Distance..
    That can be done with some test on an empty scene with a Plane:

    The Minimum Jump Distance is the Length of the Ray to cast on the High Position of the jump.
    Which means that, if the ray does not touches the ground, the animal it will go to the Fall state..
    That is why I usually set it with a value a bit higher than the Value the Debug Jump shows.

    This is a tricky setting when it comes with the Default Jump State (That requires JumpStart, Jump Air and JumpEnd)
     
  11. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    All the Dragons have a mountable Prefab inside the Integration package, you just need to Install HAP and then any of the Dragons.
    E.g.
    HAP and Unka
     
  12. MasonWheeler

    MasonWheeler

    Joined:
    Apr 2, 2016
    Posts:
    210
    I look this over, and one of the major steps is adding an animator to the animal that's set up a specific way. (This appears to implicitly assume that you don't already have one.) The dragon has an animator already set up, done in a very different style. Do you have any tutorials on the minimal work necessary to adapt an existing animator to be AC compatible?

    Also, the "C" button to calculate height, shown in the video at around 6:23, does not exist in the current version.
     
  13. Gamerzon94

    Gamerzon94

    Joined:
    Jun 5, 2019
    Posts:
    11
    It was simpler than I thought, I really didn't see it inside the package until you marked it, thanks for the help.
     
    Malbers likes this.
  14. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

    Joined:
    Dec 13, 2017
    Posts:
    323
    wow loving the animal controller :) quick question will it work with emerald ai?
     
  15. TheDigitalzombie

    TheDigitalzombie

    Joined:
    Feb 22, 2016
    Posts:
    7
    @Malbers

    Hey there! :)
    Your pack is absolutely awesome! Players really love the animations and of course me too.
    I've got a little problem now. I'm using the fox, without any of your scripts, just the bare model and the controller for the animations. Wanted to restructure everything a bit for a new assetbundle to get it nice and clean for some additional custom animations. Now I've apparently messed something up and don't know what. The fox slides on the walking/turning animations and it's pretty stuttery on the animation loop. Looks like the position is slightly reset on every loop (Using the vertical ond horizontal parameters inside the animation controller).
    Got a little vid showing my problem:


    I'm no pro and think I'm missing some little detail, maybe you've got an idea for me how to fix it. Any help would be greatly appreciated.

    Offtopic:
    I really liked your interview with The Messy Coder on YT some time ago :D
     
    Last edited: Dec 3, 2020
  16. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    3,822
    Poor big Raccoon is imprisoned:

     
  17. RemusRain

    RemusRain

    Joined:
    Mar 9, 2019
    Posts:
    15
    Thank you! This helped.
     
    Malbers likes this.
  18. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    To migrate it to the Animal Controller , it needs to have an Animal Controller Animator... with all its Parameters.
    otherwise it wont work with the Riding system

    Making a Wizard window to set up an Animal Animator from scratch is on my to do list, but it wont be anytime soon.

    upload_2020-12-4_14-35-13.png

    If is left to 1 (default value) the Height will be calculated automatically
     
  19. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    Sadly, no, the Animal Controller does not have an integration with emerald AI, but the models itself, without the Controller can be use for sure with that asset, just like any other model
     
  20. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    Thank you for using the package!!
    I think that is an easy fix... that usually happens when there's no Avatar on the Animator:
    upload_2020-12-4_14-41-11.png
    Make sure you have the proper Avatar set on the Animator (In your case the Fox Avatar)
     
  21. TheDigitalzombie

    TheDigitalzombie

    Joined:
    Feb 22, 2016
    Posts:
    7
    That wasn't it. I think it had something to do with renaming and moving the controller. But it's fixed. I just started everything from the beginning with a blank project and it works now. :) Got a nice new clean prefab and can now start to adding animations. Thanks for your help.
     
    Malbers likes this.
  22. Gamerzon94

    Gamerzon94

    Joined:
    Jun 5, 2019
    Posts:
    11
    Hello, I am working with playmaker, I have created a game over screen and I use the restartlevel function, but once I use it the lookat script stops working (I leave you an image of the unity console)


    I appreciate the help to solve the error.
     
  23. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    Try Disabling the Look At script before you call the GameOver function..

    Also do you freeze your game ? Time.timescale = 0 ?
     
  24. Gamerzon94

    Gamerzon94

    Joined:
    Jun 5, 2019
    Posts:
    11
    yes, we are using Time.timescale = 0, so should we Disabling the Look At script before changing the timescale?
     
  25. MasonWheeler

    MasonWheeler

    Joined:
    Apr 2, 2016
    Posts:
    210
    Why does MAnimal have references to the Animator and Rigidbody that need to be set in the Inspector rather than just grabbing them off the GameObject? I didn't even know that was there until I spent half an hour in the debugger trying to figure out why the MAnimal I had copy/pasted from another animal was failing to animate the one I copied it to.
     
  26. MasonWheeler

    MasonWheeler

    Joined:
    Apr 2, 2016
    Posts:
    210
    Also, the documentation recommends putting colliders on the animal. But if I use RASCAL to put colliders on the dragon, suddenly it walks exceptionally slow when moving, to the point where it doesn't appear to be moving at all unless you carefully observe the change in position over many seconds. Changing the Animator's Update Mode from "Animate Physics" to "Normal" fixes this, but I'm not quite sure why it's happening in the first place.
     
  27. nanditho

    nanditho

    Joined:
    Jan 10, 2018
    Posts:
    26
    I really like the Horse Animset Pro asset. The problem is I found no documentation about adding new abilities to the rider and to the animals(horse).

    so i tried to integrate it with Ultimate character controller by opsive. the error happens after the riders dismount from the horse, my riders keep falling out of the terrain (mesh terrain) like it can not detect/collide with mesh terrain collider.

    But when i try with the demo HAP, everything run smoothly.

    So, can you give me advice.

    And, is it possible to add new abilities to the riders or animals (Horse), can you give a detail documentation please. Thanks

    The screenshot
    https://ibb.co/1GzhsQz

    Other issue is,
    "Resource ID out of range in SetResource: 1056104 (max is 1048575)"

    The error occurs after activating the AI object (the child object of horse).
     
    Last edited: Dec 13, 2020
    Malbers likes this.
  28. MasonWheeler

    MasonWheeler

    Joined:
    Apr 2, 2016
    Posts:
    210
    This just keeps getting crazier. I want my dragon to walk around, so I put a MAnimalAIController on it, and now it falls through the terrain as soon as it starts walking.

    If I disable the AI controller, it stops falling through the terrain but it also won't animate when it walks, so it's definitely the AI controller causing it to fall, but I can't figure out where. The rigidbody has gravity turned off. The MAnimal component doesn't have the ability to disable gravity, but it has its Force set to 0. And nowhere in the AI controller script does it set the transform.position, or have a reference to "gravity" or "Vector3.down" at any point. So what in the world is causing it to noclip through the terrain and fall?
     
    Malbers likes this.
  29. JKURNIA

    JKURNIA

    Joined:
    Dec 27, 2019
    Posts:
    4
    Hi, this is a great asset. A quick question, would this work with Humanoid rig?
     
    Malbers likes this.
  30. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    Here's a fix LookAt Script and Time Scale

    Let me know if it works :)
     

    Attached Files:

  31. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    The Animator and RB are grabbed in the code if they are set as null

    But if the Animator or RB are on a different GameObject inside the animal Hierarchy you can set them in those parameters.
    This happens with the Wagon example and the horse, where the Rigid body is set on a different gameObject.
     
    MasonWheeler likes this.
  32. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    I'm not familiar with Rascal, what is that.. is it an asset?
    if so I havent test with the animals to see the issues that may cause.
    Edit:
    Found it.. it is an asset indeed.
    So the problem with the colliders is that the friction does not allow the animal to move.. when touches other surfaces
    As default I set all the colliders in an animal to the Flesh material (which it has zero friction)
    upload_2020-12-14_16-0-10.png
    Try that and tell me if it works for you
     
  33. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    one of the most common problem about the Dragon falling into the ground is that it does not recognize the terrain it has:
    https://malbersanimations.gitbook.i...-components/manimal-controller/general#ground
     
  34. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    Yes it does!
    The asset includes a Humanoid (Steve)
    you can see the Rider here being controlled by AC
     
  35. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    Yes I found that error too and I was all weekend trying to fix it

    The new Update is live on the Integration folder ;)
     
  36. MasonWheeler

    MasonWheeler

    Joined:
    Apr 2, 2016
    Posts:
    210
    I've got the Ground layer set to "Default" which is the same layer the terrain is on. (And yes, I double-checked it. The terrain's Terrain Collider is present and active.)

    Also, this is not what is shown in the link. The animal in the link is sliding along the ground, stuck in a falling animation, because he's colliding with the ground but MAnimal isn't recognizing it. This is not a MAnimal problem, it's a MAnimalAIControl problem, and the character is not sliding along the ground, but no-clipping through it and falling out of the scene.
     
    Last edited: Dec 15, 2020
  37. MasonWheeler

    MasonWheeler

    Joined:
    Apr 2, 2016
    Posts:
    210
    Will a collider with no Physics Material attached have friction? I haven't tested it but I'd sort of assume that the default would be no friction unless you assign something different.
     
  38. nanditho

    nanditho

    Joined:
    Jan 10, 2018
    Posts:
    26
    Yeah... thanks a lot

    * By the way, if you can say what is the cause of the error. It is for my knowledge. Thx:)
     
    Last edited: Dec 17, 2020
  39. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    I actually set the Flesh Material, just in case, just to be sure.

    With the align to ground feature, 2 rays are casted down to find the ground (using the ground Layer)
    if those ray miss, if they don't find a collider then it will activate the Fall State.
    The gravity is enable in each states here:
    upload_2020-12-16_12-19-49.png
    only the Fall state uses it.
     

    Attached Files:

  40. MasonWheeler

    MasonWheeler

    Joined:
    Apr 2, 2016
    Posts:
    210
    Just checked that, and Fall.Activate() doesn't get called until after the dragon has already fallen through the terrain.

    Once again, this problem is specific to the AI controller. Without that component, the problem does not reproduce; with it, it reproduces every time. I just wish I could figure out why!
     
  41. ProceduralCatMaker

    ProceduralCatMaker

    Joined:
    Mar 9, 2020
    Posts:
    108
    Dear friend, how are you doing with new Input System effort?
    Any Xmas or NewYear present arriving?
    thanks anyway for your great work.
    bye
    sergio from italy
     
  42. JBacal

    JBacal

    Joined:
    Jun 6, 2015
    Posts:
    59
    Can the forest golem animations be used with other models with a humanoid rig? Thanks.
     
  43. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    Actually yes :) I'm working on the Integration this month :) hopefully for new year's eve it will be ready

    Yes, they are rigged as humanoid :) so they can use other Humanoid animations
     
    ProceduralCatMaker likes this.
  44. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    Can you make a quick screen recording? so I can see better the issue, and then try to reproduce it on my side?
     
  45. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    3,822


    ps: I know it's a Wyvern, but everyone searches for Dragon :D
     
    Malbers likes this.
  46. MasonWheeler

    MasonWheeler

    Joined:
    Apr 2, 2016
    Posts:
    210
    Here you go. The scene is set up with a simple script that waits approximately 0.5 seconds, then tells the dragon to navigate to a certain position by calling MAnimalAIControl.SetTarget(position, true). This shows exactly what's happening, first with the AI controller on, and then with the AI controller disabled.
     

    Attached Files:

  47. AppBite

    AppBite

    Joined:
    Jul 5, 2012
    Posts:
    79
    I'm getting errors like this & I can't figure out which Mode Actions should work, is there a list somewhere? The M Animal script has a reference to Action (ModeID) & I see the list of Abilities under that.

    [Zone Sleep] cannot be activated by [Wolf Lite]. It does not have The [Mode Action (MalbersAnimations.ModeID)] or [ModeIndex 6]

    I've added an Ability of Sleep with an Index of 6 - and now it seems to play the Eat animation. :-/

    I updated to the AC released on 24th November & get the same type of error in 1 - PlayGround Wolf Lite, although I can see some of the ground Zones have been removed in the 0 - Forest scene

    I'm not much of an animation expert, so I'm cross checking with the other Malbers asset I use Little Sea Dragon, 1 - LDSea PlayGround where the Sleep does work. How do I know which Abilities I can add? Should Sleep be working for the Wolf?


    Thanks, Scott
     
  48. Daniel-Talis

    Daniel-Talis

    Joined:
    Dec 10, 2011
    Posts:
    425
    Hi, Just bought the Raven pack and am trying to get things working. None of the demos are working, keep getting a missing prefab message. Any ideas..

    Update: bought the 'Malbers animal controller' and everything seems to be present in the Hierarchy but am unable to take off in the Raven demos. WASD keys are not working. Any help?
    BTW. the wolf demo that comes with the animal controller 'is' working.
    Can't find any mention in the manual about setting up the Raven for flying and although there are plenty of demo videos of the flying raven there seem to be none on the setup.
     
    Last edited: Dec 28, 2020
  49. mferraro89

    mferraro89

    Joined:
    Feb 18, 2020
    Posts:
    1
    Hello,

    I bought the horse + animal controller pack, and also the fox and I'm not sure where to go from here. I can easily get the fox prefab to run around using wasd controls just by using the Malbers Input script, and I can get the AI fox to follow waypoints using the pluggable AI system, no issues there.

    What I'm building is a simulation of many animals, hopefully around 1000 at once all interacting and coexisting on a single island. They will need to seek water when thirsty, food when hungry, chase prey, reproduce, etc. My question is: what is the best way to approach this type of simulation?

    One option is to put all the state and logic into MonoBehaviors. This makes a lot of sense to me because each animal does have lots of state variables like hunger, HP, thirst, etc. But how do I invoke states and modes from within my MonoBehavior? Do I get a pointer to the MAnimal and call something like animal.setMode()? I can't find any method signatures that let me do this kind of thing. Do I have to change modes by emitting MEvents? If so which events do I need to emit to trigger which modes?

    A second option is to build a single state machine using MAI states, Decisions, Tasks. This works great for the zelda-like dog following tutorial, but how would I trigger state transitions based off of a piece of internal state, like how hungry that particular fox is? I can of course Create --> Malbers Animation --> Scriptables --> Variables --> Float but then doesn't that make a single globally shared float variable? Would I need to create a new, named variable for each animal's current health? It sure would be nice if this approach could work because then the entirety of a Fox's behavior could be pre-baked into a single prefab, and creating new foxes is as simple as spawning in more prefabs.

    As far as scale goes, is one of these approaches much more performant than the other? I'm working on a standard macbook pro and I'm targetting my simulation to run in WebGL eventually so I don't have a ton of resources to work with.
     
  50. warren-miller-maltd

    warren-miller-maltd

    Joined:
    Jul 26, 2012
    Posts:
    53
    hi - trying to do something a bit different:

    using the mobile scene I want to be able put the camera directly behind the wolf but I need the Movement joystick to work in this way:
    horizontal negative : wolf rotates around y to the left, opposite for the horizontal positive
    vertical positive :wolf walks forward
    vertical negative :wolf walk backwards,
    all the time the camera sits right behind the wolf.

    I've heard this being referred to as "tank cam" before

    is this sort of thing possible at all please?

    many thanks!