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

Malbers Animals-Creatures

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

  1. Farapang

    Farapang

    Joined:
    Jul 23, 2013
    Posts:
    15
    If I destroy an animal (de-spawn because of distance) while it is using an action zone, it has this error. Any ideas on how to solve it:
    MissingReferenceException: The object of type 'Animal' has been destroyed but you are still trying to access it.
    Your script should either check if it is null or you should not destroy the object.
    UnityEngine.Component.GetComponentInParent (System.Type t) (at C:/buildslave/unity/build/Runtime/Export/Component.bindings.cs:109)
    UnityEngine.Component.GetComponentInParent[IAnimatorListener] () (at C:/buildslave/unity/build/Runtime/Export/Component.bindings.cs:114)
    MalbersAnimations.Utilities.Messages.SendMessage (UnityEngine.Component component) (at Assets/Malbers Animations/Common/Scripts/Utility/Messages.cs:24)
    UnityEngine.Events.InvokableCall`1[MalbersAnimations.Animal].Invoke (MalbersAnimations.Animal args0) (at C:/buildslave/unity/build/Runtime/Export/UnityEvent.cs:207)
    UnityEngine.Events.UnityEvent`1[T0].Invoke (.T0 arg0) (at C:/buildslave/unity/build/Runtime/Export/UnityEvent_1.cs:58)
    MalbersAnimations.ActionZone+<OnActionDelay>c__Iterator1.MoveNext () (at Assets/Malbers Animations/Common/Scripts/Actions/ActionZone.cs:245)
    UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress) (at C:/buildslave/unity/build/Runtime/Export/Coroutines.cs:17)
     
    Malbers likes this.
  2. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    Humm Interesting I will Investigate it .... I believe is due because the Action has a Coroutine and is trying to access the animal after is destroyed.... with some Null checking I believe it will solved...

    I'll let you know when I kill that bug ;)
     
    Farapang likes this.
  3. GeometryBox

    GeometryBox

    Joined:
    Mar 23, 2018
    Posts:
    3
    The tiger while running if jumps into the water, it doesn't continue swimming. If it's trotting or waling before it enters the water, then it continues to move forward as desired. But jumping into the water somehow disables it's inputs.
     
  4. JasonDaze

    JasonDaze

    Joined:
    Jun 3, 2018
    Posts:
    6
    Please make a climb example in the AI scene as well.
     
    Malbers likes this.
  5. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    Hi there!!
    Can you make a video of the problem ?...to see if I can reproduce it on my side
     
  6. HeyBishop

    HeyBishop

    Joined:
    Jun 22, 2017
    Posts:
    238
    Rather than reinvent the wheel, I was wondering if anyone in this forum has written a script to command the animals to walk to where the user touches or clicks on screen. Would you mind sharing?
     
    Malbers likes this.
  7. Volcanicus

    Volcanicus

    Joined:
    Jan 6, 2018
    Posts:
    169
    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using UnityEngine.AI;
    5.  
    6. public class Movement : MonoBehaviour {
    7.     //don't forget Nav Mesh Agent and using UnityEngine.AI
    8.     //set bool parameter into animator if needed
    9.     //running is set to true and transits from idle to run
    10.     //running is set to false and transits from run to idle
    11.  
    12.     private Animator mAnim;
    13.     private NavMeshAgent mNav;
    14.     private bool mRun = false;
    15.  
    16.     void Start(){
    17.         mAnim = GetComponent<Animator>();
    18.         mNav = GetComponent<NavMeshAgent>();
    19.     }
    20.      
    21.     void Update(){
    22.         Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
    23.         RaycastHit hit;
    24.  
    25.         if(Input.GetMouseButtonDown(0)){
    26.             if(Physics.Raycast(ray, out hit, 1000)){
    27.                 mNav.destination = hit.point;
    28.             }
    29.         }
    30.  
    31.         if(mNav.remainingDistance <= mNav.stoppingDistance){
    32.             mRun = false;
    33.         }
    34.  
    35.         else{
    36.             mRun = true;
    37.         }
    38.  
    39.         mAnim.SetBool("running", mRun);
    40.  
    41.         if (mNav.velocity.sqrMagnitude > Mathf.Epsilon)
    42.         {
    43.             transform.rotation = Quaternion.LookRotation(mNav.velocity.normalized);
    44.         }
    45.  
    46.     }
    47. }
    48.  
    I use that in my other project. You may need to tweek the Malbers Animal parameters in order to get smoother movement.
    You will also have to set animation triggers based on movement as per comments.
     
    Last edited: Feb 16, 2019
    HeyBishop and Rowlan like this.
  8. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    The rabbit has a Scene sample for Point Click to move (I need to add it to all the others ones...but I'm working on the new controller to make all kinds of sample scenes for everyone ;) )
     
  9. HeyBishop

    HeyBishop

    Joined:
    Jun 22, 2017
    Posts:
    238

    This is very generous of you!! I can't wait to try this out.
    Cheers!
    Wouldn't you know, the rabbits are one of the few I haven't gotten!
     
    Malbers likes this.
  10. GeometryBox

    GeometryBox

    Joined:
    Mar 23, 2018
    Posts:
    3
    Here's the link to the video. If it goes into the water without jumping, it's all fine then. Also, if it jumps to another flat surface while running, it takes a pause and then continues the running. I have tested using both "Always Forward" selected and not selected.

    https://www.dropbox.com/s/c15vv3vnzqka1ti/TigerJump.mp4?dl=0
     
    Malbers likes this.
  11. GeometryBox

    GeometryBox

    Joined:
    Mar 23, 2018
    Posts:
    3
    Another query, the Tiger doesn't play the take damage animation in the running mode. It's working fine with the walk and the trot mode. The damage is taken on the life but the animation doesn't play. Also when the life is 0 while it's running, it stuns for a moment and continues running. It's like the run animation is overriding all other.
    It can also be reproduced in the demo scene.
     
    Malbers likes this.
  12. HeyBishop

    HeyBishop

    Joined:
    Jun 22, 2017
    Posts:
    238
    In the spirit of sharing, here is the script I wrote to have the racoon go to where the user touchs on a mobile device.

    Code (CSharp):
    1. using UnityEngine;
    2. using MalbersAnimations;
    3.  
    4. public class TouchToMoveAnimal : MonoBehaviour
    5. {
    6.     public AnimalAIControl animalAgent;
    7.  
    8.     void Update()
    9.     {
    10.         if (Input.touches.Length > 0)
    11.         {
    12.             if (Input.GetTouch(0).phase == TouchPhase.Began)
    13.             {
    14.                 Ray touchRay = Camera.main.ScreenPointToRay(Input.GetTouch(0).position);
    15.                 RaycastHit hit;
    16.  
    17.                 if (Physics.Raycast(touchRay, out hit))
    18.                 {
    19.                     Vector3 destinationPosition = hit.point;
    20.                     animalAgent.SetDestination(destinationPosition);
    21.                 }
    22.             }
    23.         }
    24.     }
    25. }
    26.  
     
    Volcanicus and Rowlan like this.
  13. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,200
    You guys are awesome. I wish those user scripts would be collected at a dedicated location. @Malbers? :)
     
    Malbers likes this.
  14. HeyBishop

    HeyBishop

    Joined:
    Jun 22, 2017
    Posts:
    238
    A strange thing is happening with the AI Raccoon after an action is triggered by an Action Zone. I have a simple scene, with the TouchToMoveAnimal script shared in my previous post, attached to the default Raccoon Poly Art AI prefab. I can touch anywhere in my scene on the navmesh, and it goes right to where I want, and then stop successfully. If the animal passes through an action zone set to automatic - it will do the action. But after, it starts walking forward indefinitely. Touching a new point on screen work. Any ideas?
     
  15. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    Found the Error...

    The Swim Animations is missing the Swim Tag
    upload_2019-2-19_11-14-35.png
     
    mandisaw, GeometryBox and Rowlan like this.
  16. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    Here's the fix for the Animator ;) I remove some transitions on the Deaths and I have added an Additive layer for damaging the animal while running
     

    Attached Files:

    GeometryBox likes this.
  17. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    I'll make a sub Folder on the Integrations folder for Community scripts ;)
     
    HeyBishop likes this.
  18. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    Automatic actions zones are meant to be used when the Animal is controlled with the Malbers Input..

    You need to make the action and continue to your desired point? or make the action and stop?
     
  19. HeyBishop

    HeyBishop

    Joined:
    Jun 22, 2017
    Posts:
    238
    I think I'd want the animal to make the action and stop. That would be true if the player sets the destination point to be the Action Zone (such as the player seeing food for the animal, selecting it to make their animal go over and eat it), or even if the player sets a destination point that is beyond an Action Zone, and the animal happen to cross over it and the animal would stop and eat/sleep/do the action.
     
  20. KeithBrown

    KeithBrown

    Joined:
    Apr 1, 2017
    Posts:
    191
    @Malbers How about a github public project? This way the scripts are not pushed to the users unless they really want them?
     
  21. Volcanicus

    Volcanicus

    Joined:
    Jan 6, 2018
    Posts:
    169
    I'd rather keep them private, curated and dealt with by the owner, Malbers, since this is a bought asset. Otherwise, it would be very tedious to keep track of all of them for all the animals without proper QA.
     
  22. RavenWoodsDE

    RavenWoodsDE

    Joined:
    Jul 13, 2015
    Posts:
    12
    Do you, by chance, take commissions too?
    I love your work, but there's a couple animals I could really use for my project, not in your roster so far though.
     
    SirTwistedStorm likes this.
  23. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    thanks for the offer, I really appreciate it, but unfortunately I'm not available...
    I'm already working on several projects at the same time besides the assets
    Kind Regards
     
    mandisaw and RavenWoodsDE like this.
  24. herr_P

    herr_P

    Joined:
    Jun 8, 2017
    Posts:
    2
    Hehey! Thanks for awesome assets!

    At some point I could swear that there was a way to toggle jump-land penalty, but now I can't seem to find it(?)
     
  25. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    Do you reffer to the Always Land Animation?? or the Issue with landing sometimes on the air?
     
  26. brettj

    brettj

    Joined:
    Feb 9, 2015
    Posts:
    43
    I'm working on a custom texture for the Wolf and noticed that a lot of the parts overlap. Could you edit the UVs so each part is separated and has it's own labeled color swatch in the PSDs? For example, It would be really helpful to have the outer edge of the wolf ears to be a color different from the nose. Thanks!
     
    Malbers likes this.
  27. Farapang

    Farapang

    Joined:
    Jul 23, 2013
    Posts:
    15
    Any news on when climbing for the Racoon will be coming?
     
  28. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    I will upgrade the currect Color Chart to the new Improved Shader Color chart 4x4 I'm using with the raccoon and the Raven :) but after I finish the new controller :)

    with the new controller :) which it will come with the horse update :)
    that is one of the reason for the new controller... So I can add or remove features without affecting the core controller..
     
    KeithBrown likes this.
  29. MisfitVillage

    MisfitVillage

    Joined:
    Jan 3, 2017
    Posts:
    14
    Hey Malbers, is it possible to use your models and anims from this package with a simpler animator (no layers etc) and none of your scripts? We would just use them for a mobile endless runner game. Basically what I'm asking is - how easy is it to remove all special features from this package and to be left with just the models and their animations?
     
  30. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    Yes you can :)

    Remove all the scripts and extra files if you like... you have everything you need to create your own Animator from scratch
     
    mandisaw and MisfitVillage like this.
  31. JohnnyFactor

    JohnnyFactor

    Joined:
    May 18, 2018
    Posts:
    343
    I would love to see a lion pack. Male, female, and cub would be ideal.
     
    Malbers likes this.
  32. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    is on my list! for the Savannah pack :)
     
    Last edited: Apr 23, 2019
    mandisaw likes this.
  33. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,200
    i hope those come realistic out of the box :D
     
    Malbers likes this.
  34. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    hahahah first the wolf and the deer (after the horse of course)
     
    Rowlan likes this.
  35. JohnnyFactor

    JohnnyFactor

    Joined:
    May 18, 2018
    Posts:
    343
    Does the bear have a stand+roar animation like what you see from trained bears in movies? I didn't see it in the video.
     
  36. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    Yes it has :) it has Roar on ground and Roar Standing
    Check the Sketch Fab :)
     
    JohnnyFactor likes this.
  37. brettj

    brettj

    Joined:
    Feb 9, 2015
    Posts:
    43
    I think the getDamaged method in the Wolf's AnimalCallBacks.cs is calculating the direction incorrectly. I should be Theircenter - Mycenter (see below), assuming Mycenter is the animal being damaged. Also, it might help to rename the variables damagedCenter and attackerCenter or something like that to make things clearer.

    Also, should DamageValues class be a struct instead?

    Code (CSharp):
    1.         public virtual void getDamaged(Vector3 Mycenter, Vector3 Theircenter, float Amount = 0)
    2.         {
    3.             DamageValues DV = new DamageValues(Theircenter - Mycenter, Amount);
    4.             getDamaged(DV);
    5.         }
    Thanks for the great assets.
     
    Malbers likes this.
  38. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    Thanks so much for this!

    I will gladly use suggestions :D
     
    Weblox and brettj like this.
  39. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    brettj likes this.
  40. mandisaw

    mandisaw

    Joined:
    Jan 4, 2018
    Posts:
    80
    The new modular controller looks great, and exactly what I need! I'm integrating multiple animals into an existing hybrid setup (Adventure Creator + Ootii Motion Controller + my own tactical RPG components), and the new approach will make integration so much easier. My game will have AI-controlled animal-companions and input-controlled animal-transformed PCs, alongside the usual humanoid characters, so the more controls in common, the better. Your packs are way more than just models+animations!

    Already had the Poly Fox for months as a dev-test, but just snapped up the full Poly Forest Pack in today's sale. Totally looking forward to the Savannah Pack :D, it'll be perfect for my MidEast/Silk Road-setting. Is there a preview coming for that one, or even a list of planned animals? :crosses fingers for a hyena & gazelle/antelope:

    (Enjoy the vacation, no problem waiting on a reply :) )
     
    Malbers and DrOcto like this.
  41. netpost

    netpost

    Joined:
    May 6, 2018
    Posts:
    388
    Hi,

    I am just wondering the poly art forest was reduced at $59 for the may sale and it isn't anymore. Wasn't the sale until may 15?

    Thanks.
     
  42. mandisaw

    mandisaw

    Joined:
    Jan 4, 2018
    Posts:
    80
    There are two sales categories happening concurrently - the main sale is 50% off a bunch of assets through mid-May, but there's also a one-day sale of 70% off on a single asset. The asset picked for the 70% sale changes daily (I think at midnight Pacific time), probably to encourage people to check back every day.
     
  43. netpost

    netpost

    Joined:
    May 6, 2018
    Posts:
    388
    @mandisaw I wasn't aware of the one-day sale of 70% off on a single asset. Thanks a lot for the info.
     
    mandisaw likes this.
  44. Simod

    Simod

    Joined:
    Jan 29, 2014
    Posts:
    176
    Hi Malbers,:)

    Just in case: Wolf FBX model is crashing HairWorks FurViewer. Was not a issue a year and half ago.
    Not that critical, though I find FurViewer is quite handy for authoring a hair objects before importing into Unity.

    PS. Currently working on a fur objects for your creature assets
     
    Last edited: May 13, 2019
  45. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,200
    omg awesome :eek::)
     
  46. JohnnyFactor

    JohnnyFactor

    Joined:
    May 18, 2018
    Posts:
    343
    I've bought the forest animals pack and I'm scripting a basic roar but I can't find a reference to stand.roar anywhere. It doesn't seem to have an ID and I don't know how to access it otherwise. Could you tell me what I'm missing here?

    Code (CSharp):
    1.     void Start()
    2.     {
    3.         GetComponent<Animal>().SetAction(12); // stand
    4.         StartCoroutine(RoarGo());
    5.     }
    6.  
    7.     IEnumerator RoarGo()
    8.     {
    9.         yield return new WaitForSeconds(3);
    10.         GetComponent<Animal>().SetAction(?); // what should go here?
    11.     }
     
  47. conan222

    conan222

    Joined:
    Dec 15, 2018
    Posts:
    26
    Hi, I have your Poly Art Deer 3D model for Unity but am unable to work out how to incorporate the deer into my own scene.

    I've studied the AI demo scene and see that the deer follow waypoints but even if I copy the terrain, elk and waypoints into my own scene the elk just stays in one spot. Could you please give me any advice on how I can make an elk run in my own scene following some sort of path that goes right in front of the camera ? I'm using Unity 2018.3.3f1 (64-bit).

    Thanks. Andrew
     
  48. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    Code (CSharp):
    1.     void Start()
    2.     {
    3.         GetComponent<Animal>().SetAction(12); // stand
    4.         StartCoroutine(RoarGo());
    5.     }
    6.  
    7.     IEnumerator RoarGo()
    8.     {
    9.         yield return new WaitForSeconds(3);
    10.         GetComponent<Animal>().SetJump(); // **Try this**
    11.     }
     
    mandisaw and JohnnyFactor like this.
  49. Hoorza

    Hoorza

    Joined:
    May 8, 2016
    Posts:
    45
    Hi all. Malbers great assets! Using your foxes for our Sheepy project. Since I have updated Unity to 2019.1 I get warnings about the obsolete API, namely:

    Code (CSharp):
    1.  
    2. MalbersAnimations\Common\Scripts\Effects\Editor\EffectManagerEditor.cs(234,107): warning CS0618: 'PrefabUtility.GetPrefabObject(Object)' is obsolete: 'Use GetPrefabInstanceHandle for Prefab instances. Handles for Prefab Assets has been discontinued.'
    3.  
    4. Assets\MalbersAnimations\Common\Scripts\Effects\Editor\EffectManagerEditor.cs(235,107): warning CS0618: 'PrefabUtility.GetPrefabObject(Object)' is obsolete: 'Use GetPrefabInstanceHandle for Prefab instances. Handles for Prefab Assets has been discontinued.'
    5.  
    6. Assets\MalbersAnimations\Common\Scripts\Effects\Editor\EffectManagerEditor.cs(236,119): warning CS0618: 'PrefabUtility.GetPrefabObject(Object)' is obsolete: 'Use GetPrefabInstanceHandle for Prefab instances. Handles for Prefab Assets has been discontinued.'
    7.  
    I have spent most of the day trying to change the code to the new API according to Unity documentation but I suck at more complex code still. Did you find by any chance with what those lines have to be replaced with so it doesn't throw those three warnings?

    Any help will be appreciated, it is a long project and I do not want to find my self stuck in a half a year or so trying to change so much more to make it work

    Thanks a lot!
     
    Malbers likes this.
  50. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    Here a small preview for the new controller :)

     
    Last edited: May 19, 2019
    nirvanajie, DrOcto and Simod like this.