Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Malbers Animals

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

  1. GingerDr73

    GingerDr73

    Joined:
    Sep 25, 2013
    Posts:
    21
    Ok, I've given that a try and made sure to upgrade all the animals. Still getting the same problem. Gonna try poking around in the AnimalAIControl script a bit more since that seems the logical place for the problem to be coming from.

    EDIT: Tried swapping in the 1.6 version of the AnimalAIControl script and the problem is gone. I'm assuming that version probably won't work with the ravens though.
     
    Last edited: Jul 18, 2018
  2. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    1,580
    Yeap that last version has the ability to fly with the Animal AI Control...

    Try Testing it on an Empty project any of the animals with the last version... I asume it should be a simple issue... like the NavMesh isn't being recognized
     
    GingerDr73 likes this.
  3. uknowunity

    uknowunity

    Joined:
    Jul 12, 2018
    Posts:
    2
    I have a fox that is trying to attack the player but the "Attack1" animation doesnt work. My trigger colliders do work. I dont understand how to use SetAttack(). Can you provide me simple code with SetAttack()?


    Code (CSharp):
    1.  
    2.  
    3.     void Update()
    4.     {
    5.         timer += Time.deltaTime;
    6.         if (timer >= timeBetweenAttacks && playerInRange)
    7.         {
    8.          
    9.             Attack();
    10.         }
    11.  
    12.     }
    13.  
    14.  
    15.     void Attack()
    16.     {
    17.         timer = 0f;
    18.  
    19.         if (playerHealth.currentHealth > 0)
    20.         {
    21.             playerHealth.TakeDamage(attackDamage) ;
    22.             Debug.Log("Attacked!");
    23.  
    24.         anim.SetTrigger("Attack1");
    25.     }
    26.     }
     
  4. pixelsteam

    pixelsteam

    Joined:
    May 1, 2009
    Posts:
    924
    Do you have a new video on how to get this working? thx
     
  5. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    1,580
    That Demo scene is included on the Raven Asset... but you need to also have Horse Animset Pro(HAP) Installed on the same project :) otherwise you will get some missing scripts (which belongs to HAP)
     
    pixelsteam likes this.
  6. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    1,580

    If you are using the Animal Script.... you need to have a reference for the Animal Component of the Fox,
    and use that reference to call the SetAttack() method .

    like on the Start() of your script :

    Code (CSharp):
    1. Animal fox = GetComponent<Animal>();
    2. fox.SetAttack();
    Using GetComponent<> if you have your script in the same level of the Animal Script...

    and it should be something like this:

    Code (CSharp):
    1.         void Update()
    2.         {
    3.             timer += Time.deltaTime;
    4.             if (timer >= timeBetweenAttacks && playerInRange)
    5.             {
    6.                 Attack();
    7.             }
    8.         }
    9.  
    10.  
    11.         void Attack()
    12.         {
    13.             timer = 0f;
    14.  
    15.             if (playerHealth.currentHealth > 0)
    16.             {
    17.                 fox.SetAttack();   //Call for the animal Attack
    18.                 playerHealth.TakeDamage(fox.attackStrength); // Being the Attack strength the damage the animal does
    19.                 Debug.Log("Attacked!");
    20.             }
    21.         }
     
  7. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    1,580
    Poly Art and Realistic Raccoon :)

    It needs some texturing though :D upload_2018-7-22_16-36-22.png
     
  8. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    1,580
    upload_2018-7-22_19-47-11.png
     
    Last edited: Jul 23, 2018
  9. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    1,580
  10. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    887
    Stop the tease :D Also now imagine a majestic realistic deer in the background :)

    Is there an approximate asset store submission date? Must have the raccoon as well :D
     
  11. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    887
    Has anyone figured out how to import the fbx files properly into blender, modify them and export them again, so that everything (especially animations) remain intact?
     
  12. Blueeyer27

    Blueeyer27

    Joined:
    Feb 15, 2015
    Posts:
    2
    Hey! The assets are cool but there's something wrong with Cougars Magic Effect...
     
  13. Blueeyer27

    Blueeyer27

    Joined:
    Feb 15, 2015
    Posts:
    2
  14. uknowunity

    uknowunity

    Joined:
    Jul 12, 2018
    Posts:
    2
    Hi there im trying to make smarter AI for the animals but im stuck on some things and tried hours of tweaking.

    I geuss there is problem in AttackTrigger.cs the ANIMAL attacks the PLAYER correctly, but if there is another ANIMAL they hit also the ANIMAL.

    I want the animals only hit players. This is my slightly changed attacktrigger:
    P.S everything works besides what I talked about

    Could you give me help me with some example codes?

    Code (CSharp):
    1.  
    2. public int index = 1;
    3.         public float damageMultiplier = 1;
    4.         public float PushForce = 0;
    5.  
    6.         private Animal myAnimal;
    7.         private IMDamagable enemy;
    8.         private Collider _collider;
    9.  
    10.  
    11.         public bool debug = true;
    12.         public Color DebugColor = new Color(1, 0.25f, 0, 0.15f);
    13.  
    14.         public Collider Collider
    15.         {
    16.             get
    17.             {
    18.                 if (!_collider)
    19.                 {
    20.                     _collider = GetComponent<Collider>(); ;
    21.                 }
    22.                 return _collider;
    23.             }
    24.         }
    25.  
    26.        public void Start()
    27.         {
    28.             myAnimal = transform.GetComponentInParent<Animal>();                //Get the Animal Component on the Root of this Animal
    29.  
    30.  
    31.         }
    32.  
    33.         void OnTriggerEnter(Collider other)
    34.         {
    35.             if (other.isTrigger) return;                                                //just collapse when is a collider what we are hitting
    36.             enemy = other.GetComponentInParent<IMDamagable>();                          //Get the Animal on the Other collider
    37.  
    38.             if (enemy != null) //if the other does'nt have the animal script skip
    39.             {
    40.              
    41.                 if (myAnimal.GetComponent<IMDamagable>() == enemy) return;                      //Don't Hit yourself
    42.  
    43.                 Vector3 direction = myAnimal.transform.position - other.bounds.center;       //Calculate the direction of the attack
    44.  
    45.                 DamageValues DV = new DamageValues(direction, damageMultiplier * (myAnimal ? myAnimal.attackStrength : 1));
    46.  
    47.            
    48.  
    49.                 enemy.getDamaged(DV);
    50.             }
    51.             else
    52.             {
    53.                 if (other.attachedRigidbody && PushForce != 0)        //If the other has a riggid body and it can be pushed
    54.                 {
    55.                     other.attachedRigidbody.AddForce((other.transform.position- transform.position).normalized * PushForce, ForceMode.VelocityChange);
    56.                 }
    57.             }
    58.         }
     
    Last edited: Jul 27, 2018
  15. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    1,580
    Last edited: Jul 29, 2018
  16. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    1,580
    The little raccoon is already walking :D :D
    Forums.gif
     
  17. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    1,580
    You can add a Layer Mask to the attack trigger to only attack for example the "Player" Layer
    or add a string to compare with the other (the entering collider)..
    if that other.tag == "Player" return (ignore all the rest of the code)
     
  18. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    1,580
    I had to do it :D :D
    Face.gif
    Rolling reference.gif
     
  19. b1gry4n

    b1gry4n

    Joined:
    Sep 11, 2013
    Posts:
    51
    pumped youre doing a realistic set. cant wait for realistic deer/bear/wolf ;)
     
    Malbers and Rowlan like this.
  20. Team21Dev

    Team21Dev

    Joined:
    Apr 2, 2017
    Posts:
    5
    I will buy all your realistic ones! They are looking so good! I already have the poly ones. You, sir, are a genius with your animations! I hope you keep the rolling one for the racoon! It's adorable!
     
    Malbers likes this.
  21. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    1,580
    Thanks so much for your support! I really appreciate it :D :D
     
    Team21Dev likes this.
  22. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    1,580
    The Red Panda is one of the Skins :D :D
    upload_2018-8-23_19-8-8.png
    upload_2018-8-23_19-9-3.png
     
  23. Necka_

    Necka_

    Joined:
    Jan 22, 2018
    Posts:
    390
    Hello MalberS,

    I'm having an odd issue and I'm probably missing something obvious... but it's annoying me now, so I might just need to learn something here.

    I'm using animals (deers, wolves and foxes) as NPC right now, with Nav Mesh agent doing their routines over your premade actions.

    My character is using Ootii's Motion controller (no integration used as I don't use the mounting now). I've added a Kinematic rigidbody to my character (I thought it is important but my issue exist even without the rigidbody on the character).

    My character is pushing the animals when crossing their way. Again Rigidbody or not.

    In Motion Controller I've set the collision with the animals layer. My character have its own characters layer.

    If I disable in preferences->physics the collision with the Animals layer, then I run through them, which isn't what I'm looking for either, I'd like to have the animals to stop the character, like a wall (and it works against walls)

    I believe it's because of the rigidbody on the animals. Is there an easy way to have the behaviour I'm looking for? at the moment it's quite weird
     
  24. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    1,580
    You can check out now on Sketchfab all the Animations available for the Realistic and #PolyArt Raccoon
     
    ftejada and Rowlan like this.
  25. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    1,580
    This is more on the part on how the Motion Controller works... same happens to me with the Horse... when Ootii's controller collides with the horse is like colliding with a wall... but if you use any other controller ..Invector, TCP or the one I provide.. the rigid bodies react as expected... according to the mass of each animal and your character..
    I believe @Tryz can help you in that area..
     
  26. Necka_

    Necka_

    Joined:
    Jan 22, 2018
    Posts:
    390
    Thanks Malbers, I Will ask him for support on that topic then, wasn't sure who to ask first ;)
     
    Malbers likes this.
  27. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    533
    Hi @Malbers I hope you get a realistic version of all your assets ... It's the only thing I need to buy them all for my Island.

    One question ... Do you admit animal suggestions? Since I am trying to create several ecosystems in my game and I need a great variety of animals ... Many of which you do not have among your assets ...


    regards
     
  28. Weblox

    Weblox

    Joined:
    Apr 11, 2016
    Posts:
    256
    Hi @Malbers

    Do you have integration for your Dragons & Animals and Emerald AI available?
     
    Malbers likes this.
  29. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    1,580
    Yes you can suggest animals!

    But here's the thing
    This is my schedule 'til the end of the year...

    -Elemental Dragon and Wyvern Dragon,
    -Super Update for Horse Animset Pro
    -This new Update will include:
    * New Animal Controller Script which will be more modular and more integration friendly
    *A lot of new goodies for HAP only.
    *Integrations like Emerald, Adventure Creator, behaviour designer and other High Level Assets on the Store


    and after that I will continue with the Realistic Version of the remaining animals, which will also include a huge set of new animations.. just like the ones on the raccoon (this will be by the beginning of next year)

    So new animals won't be available any time soon :( .... but I have a list of them so feel free to toss some new suggestions
     
  30. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    887
    Nooooooooooooooooooooooooooo ... I need realistic deer running around in huge landscape. Soonish :D
     
    Malbers likes this.
  31. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    887
    I toyed around with the sea dragons recently and wouldn't mind dolphins, the animation is there already, around 00:55:

     
    ftejada and Malbers like this.
  32. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    1,580
    I'm really sorry , but I am one person and I have soooo much to do.....

    I need to clone my self!!!!!
     
    Rowlan likes this.
  33. cygnusprojects

    cygnusprojects

    Joined:
    Mar 13, 2011
    Posts:
    659
    Hi @Malbers,
    Sorry if this has been asked before. I have some question when using the poly fox asset in my game. How can I force a dead of my player character? I want it do die when it falls from a cliff, so it can be respawned to the latest checkpoint. Any pointers would be greatly appreciated.
     
  34. scullyuk2017

    scullyuk2017

    Joined:
    Aug 23, 2017
    Posts:
    1
    Any chance you could reupload this with the latest node canvas, im unable to view the BT files unless im doing something wrong but my behaviour trees are .asset files.
     
  35. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    1,580
    Mustakaapu, GingerDr73 and Rowlan like this.
  36. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    1,580
    And!!! almost there!
    The Raccoons should be out this week mean while ... enjoy ;)
     
    mandisaw, KeithBrown, Hitch42 and 3 others like this.
  37. sky_dragon

    sky_dragon

    Joined:
    May 27, 2016
    Posts:
    11
    WOOOO, it's so cool! After finishing raccoons, will the forest set be released? I am looking forward to it.
     
    Malbers likes this.
  38. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    1,580
    Yes it will!! ;)
     
  39. Necka_

    Necka_

    Joined:
    Jan 22, 2018
    Posts:
    390
    Hi Malbers,

    I have an issue with the Animal AI
    upload_2018-9-7_19-1-15.png

    I'm creating a small scene where some animals (2 fox, 4 deers, 2 wolves) have some routine (basically each animal has his own set of sleep, eat, lay down to avoid having sometime 3 animals sleeping on the same spot)

    They have a nav mesh surface dedicated to them and the area is surrounded by steepness so they aren't supposed to go elsewhere

    upload_2018-9-7_19-7-2.png
    upload_2018-9-7_19-7-28.png

    It works quite well but sometime, an animal will just go crazy and start running like hell above the mountain and run until the end of the terrain. Which creates some big frame drop and eventually errors.

    I do know that I'm keeping those animal captive and maybe they want to break free, but it's a simulation and they're not supposed to be capable of doing so :)

    Do you know why it can happen?

    I just tested now for 10mn and after 3mn one wolf ran away. Sometime it's another animal, sometime it's two, it's really random.
     
  40. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    1,580
    Those errors really tricky to find if it only happens from time to time...

    Lets do this :)
    try with only waypoints
    and try with only ActionZones... to scale down the problem :) and tell me which one is causing it
     
  41. Necka_

    Necka_

    Joined:
    Jan 22, 2018
    Posts:
    390
    I didn't set any waypoints actually, it's only action zones

    upload_2018-9-7_19-24-21.png

    upload_2018-9-7_19-24-48.png

    They are all connected together (and never one can go to the same zone again)
     
  42. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    1,580
    I made an Update yesterday to all the animals so you should update the assets...
    I fix a ton of little bugs and one of them was on the Action zones..

    Try updating and test it out again..

    you should get some errors with the Action Zone Editor script.... you can remove it safely since is not longer used
     
  43. Necka_

    Necka_

    Joined:
    Jan 22, 2018
    Posts:
    390
    Ah ok, thanks. I have to check about the update, because I had already updated all the animators to stop the bug where the animal slide when doing an action. You added the rigidconstrain on a few of the actions but some were missing or starting too late, so if I update I'm going to have to do that again :)
     
  44. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    1,580
    Then just update the Scripts folder :) that way you don't loose your changes
     
  45. Necka_

    Necka_

    Joined:
    Jan 22, 2018
    Posts:
    390
    I saw you added stances, I thought it would be in the animator :) you didn't touch the animator much?
     
  46. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    1,580
    for now Animals that does not have stance animations that will be ignored... is only visible with the new raccoon ...
    Eventually I will add the Animations to all the old animals... (Sneak, Walk Wounded, walk on two feets, Combat Stance... etc)

    To see the Stance in action take a look here :
    http://webplayer.malbersanimations.com/ReRaccoon/
     
    mandisaw likes this.
  47. Necka_

    Necka_

    Joined:
    Jan 22, 2018
    Posts:
    390
    Perfect, thanks a lot for all those explanation, I will try with the update and see how those actions goes. I guess if there is no more action zones editor I need to use waypoints to create my routines (the random aspect was a good thing)
     
    Malbers likes this.
  48. Necka_

    Necka_

    Joined:
    Jan 22, 2018
    Posts:
    390
    So... I'm a bit confused now. Did you update or create some documentation somewhere about how actions/action zones works now? I opened the Fox AI demo scene and all the foxes goes to their action zones and do nothing at all once there.

    Let's make it simple: how should I setup an animal that:
    -Goes to zone eat (start eating), then
    -Choose randomly to go either to sleep or to lay down, then,
    -Go to sleep or eat and do that action and repeat choosing between eating or the other missing action

    Of course if you already explained that somewhere just point me to it I'll work it out :) I'm just confused because I was playing with those action zones for like 2 weeks and finally got it all to work (out of my little bug issue) but now it changed

    Edit: Tried to understand, I think at the end nothing really changed except that I need to add those to the action zone [Action]
    upload_2018-9-8_3-26-26.png

    Those were missing (for some action zones) in the demos, added them and now it works. I'll try in my project now but can you confirm that nothing else is required from your recent actions changes?

    I also deleted the "common" folder and reimported it from one animal pack because I was getting issues probably because of folders not required anymore
     
    Last edited: Sep 8, 2018
    Akshara likes this.
  49. Necka_

    Necka_

    Joined:
    Jan 22, 2018
    Posts:
    390
    Ok so it works with the update and new actions, I noticed quite some improvements on the performances here, gain some FPS.

    But I still have the bug, here it's a little fox who decided to break lose and ignore the navmesh to get stuck running forever in that rock (which is also a navmesh obstacle)

    upload_2018-9-8_3-36-14.png

    While typing those lines it's a deer who decided to escape and run away from the zone at the end of the terrain :(

    It's kind of like the AI agent stop working at some point, ignore the navmesh and just run straight non stop. When it gets too far I then get this error which isn't the cause of the problem but a result:

    upload_2018-9-8_3-39-46.png

    Clogging the console and dropping performances.

    There are no waypoints in this scene, only action zones
     

    Attached Files:

  50. b1gry4n

    b1gry4n

    Joined:
    Sep 11, 2013
    Posts:
    51

    sorry if im blind. were you ever able to get around to this tutorial? i am 90% confident i could achieve this myself, but i would like to see how you do it to make sure im not missing anything
     
    Malbers likes this.