Search Unity

Malbers Animals-Creatures

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

  1. darrennorthcott

    darrennorthcott

    Joined:
    Jun 17, 2014
    Posts:
    20
    Thanks Malbers, but I've reduced it to 0.2 and I still get the same issue of 'landing in mid air', except now when lands on an angle, the ray is too short to detect that he's landed...
     
    Last edited: Jun 1, 2018
  2. Kaen_SG

    Kaen_SG

    Joined:
    Apr 7, 2017
    Posts:
    206
    kca, lolaswift, Vog and 5 others like this.
  3. darrennorthcott

    darrennorthcott

    Joined:
    Jun 17, 2014
    Posts:
    20
    Update, so I've actually tried every value for fall ray multiplier and I'm still getting the same result... any thoughts?
     
  4. TheSammyDee

    TheSammyDee

    Joined:
    Aug 13, 2017
    Posts:
    4
    Hello Malbers, thanks for your great work! I'm using the deer and it's just beautiful.

    I'm having a little trouble though, I feel like I must be missing something obvious. I tried to make a command to make his sleep, looking at the Callbacks example, it looks like the only thing the sleep button does is call SetAction(6) but when I call that from my own script, the animation plays for him to lay down and then he immediately gets back up. From what I can gather from the animator, Stand needs to be set to false to wake him up, so I guess Stand is never being set to true. It seems like not because even when the deer is not moving the animator shows that he is in the locomotion state in my scene instead of idle. Do I need to set Stand manually somehow?

    Thanks!
     
  5. Kaen_SG

    Kaen_SG

    Joined:
    Apr 7, 2017
    Posts:
    206
    Not familiar with the deer... but for the animal script callbacks... I believe any movement, change of speed (Eg. Setspeed=1) or Jumping (SetJump) will disable the sleeping state.
     
  6. dl290485

    dl290485

    Joined:
    Feb 4, 2018
    Posts:
    160
    Sorry this would have been covered on another page I'm sure, but can someone please tell me if the controller for poly animals includes gamepad? Or is it just mouse + keyboard?

    If it doesn't include gamepad, would it be 'hard' (relative term) to set it up? I can't actually program myself but get by pretty OK using Play Maker.
     
  7. TheSammyDee

    TheSammyDee

    Joined:
    Aug 13, 2017
    Posts:
    4
    Hi Gabriel_SG, I haven't told him to move or change speed though and he still stands up, the sleep state is getting disabled on its own as soon as the lying down animation finishes. How do I make the animals stay in the sleeping state?
     
  8. Kaen_SG

    Kaen_SG

    Joined:
    Apr 7, 2017
    Posts:
    206
    IMHO, you haven't provided enough information to do any troubleshooting... maybe post a screenshot, video or your script. Because well... "works in the demo" and "works for me" (TM). :p
     
    TheSammyDee likes this.
  9. TheSammyDee

    TheSammyDee

    Joined:
    Aug 13, 2017
    Posts:
    4
    demoScene.PNG myScene.PNG

    demoSleepAnimation.PNG

    mySleepAnimation.PNG
    myIdle.PNG
    Right, thanks for your time here. Here's what I've got . The first pic is the demo scene. So far as I can tell, it's just the deer prefab as is, and the button labelled Sleep is just calling SetAction(6) on the deer (or elk, as this skin is named). I'm not seeing anything else that is changing when that button is pressed, or anything else acting on the deer in the scene. When the button is pressed, the deer lays down and then stays there sleeping until the stand button is pressed.
    In my scene, the second pic, I have the same deer (elk) prefab, and my own button that calls SetAction(6) on the deer. I have my own additional controller as well but I've turned off the extra parts so the only part being run is below. When I press my sleep button, he lays down, but as soon as that animation has completed he goes straight to the get up animation and returns to the default standing position, he won't stay asleep.
    The next two images show the parts of the Animator for sleep. In the demo scene, it reaches the box titled Sleep, and cycles there. In my scene, Sleep starts to play but Sleep to Stand also starts to play and then it just carries on to Exit from there. The transition from Sleep to Sleep to Stand is triggered by Stand being false.
    It would seem that my Stand is in the wrong state, because the last image is the Animator when the deer is idling. The demo scene (not pictured) cycles in Idle States when idle, but mine pictured above cycles in Locomotion even though nothing is moving him. The transition trigger is Stand being true. So it would seem obvious that my Stand is always false for some reason, but when I debug out the stand value every frame, it is always true! I put a breakpoint on the property that changes the value of stand, but it never gets hit. :confused:

    Code (CSharp):
    1. private void Start()
    2.     {
    3.         Debug.Log("start controller");
    4.         trackableEventHandler.OnTrackingFound += EnableAnimal;
    5.         trackableEventHandler.OnTrackingLost += DisableAnimal;
    6.         DisableAnimal();
    7.     }
    8.  
    9.     private void EnableAnimal()
    10.     {
    11.         animal.gameObject.SetActive(true);
    12.         heading = Vector3.ProjectOnPlane(animal.transform.forward, Vector3.up);
    13.         targetDirection = heading;
    14.         lastChangeTime = Time.time;
    15.         animalEnabled = true;
    16.     }
    17.  
    18.     private void DisableAnimal()
    19.     {
    20.         animal.gameObject.SetActive(false);
    21.         animalEnabled = false;
    22.     }
     
  10. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    The Exit transition for the Sleep Action on the animals is that Stand = false right ??

    this is the line of code on the AnimalMovement script that makes the Stand variable to be false:
    upload_2018-6-6_13-28-22.png

    So if any of those conditions are true.... then Stand = false and the animal will no longer be on the sleep state..
     
    TheSammyDee likes this.
  11. dl290485

    dl290485

    Joined:
    Feb 4, 2018
    Posts:
    160
    Guys, honestly I'm a bit surprised to have been ignored entirely. Surely someone could have spared the time to write three letters to my question: "yes"

    I'm planning to get all of the poly animals, but I started with just to bear to see the deal. So "yes enquirer (me), it does work out of the box with a gamepad".
     
  12. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    I'm really sorry for the late response.... I totally missed your post.. it was not intentional

    Yes.! it work with game pad you just have to set the Inputs Manager for the game pad and set those inputs on the Malbers Input Script
     
    dl290485 likes this.
  13. TheSammyDee

    TheSammyDee

    Joined:
    Aug 13, 2017
    Posts:
    4
    Ah ha, that was just the hint I needed! I had my Debug statement checking the value of stand on line 691 where it was still true all the time, but moving it to 696 showed that it was being set to false. Following that thread, I found that the problem was that because I had parented everything under another object, the deer's scale was 0.1 and that was causing a problem with the raycast that checks for the ground being very tiny and not reaching, so it thought the deer was always falling. After unparenting him, his scale was 1 again and now he stays asleep. Thanks a bunch!
     
    Akshara and Malbers like this.
  14. HeyBishop

    HeyBishop

    Joined:
    Jun 22, 2017
    Posts:
    238
    I can tell that there is a ton of functionality built into these animals. Alas, with the documentation still far from complete I still feel like I'm doing too much detective work, and I often wonder if I'm doing a lot of unnecessary extra coding to do something that might be already built in?

    I want want my AI animal to attack another AI animal. I'm in the process of re-writing a script for the hunter animal to spot prey - will probably find an interface I'll call IPreyable that I will put on every animal and the 3rd Person Player (not an animal).

    So, on the hunter, SetTarget(prey.transform) is called, it walks over to the prey - then what? I've tried adding SetAttack() to the OnTargetArrived events, but it just triggers the animation of attack without much direction. If the prey walks away, or is faster than the hunter's default walk speed, or is pointing in the wrong direction - then the hunter attacks thin air. I feel like there's got to be a better way than what I'm doing.

    Here are two examples of my animals in action:
     
    Last edited: Jun 9, 2018
  15. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    Hey @HeyBishop :)

    Sorry for the late response...

    AnimalAiControl on my assets is very basic.... I want to make in the future more complex behaviours that people can use from scratch... but for now you what you can do with the AnimalAiControl is to go from one point to another. nothing fancy there

    The Attacking of the animals works with triggers... so the attacked animal wont be damaged, if is not on the range of Attack Trigger of the Attacker... what you can do is to increase the size of the attack triggers... to help a little .
    Also you can assist a little if you make some logic that the AI Animal when Attacking is always looking to the Prey...
     
    HeyBishop likes this.
  16. HeyBishop

    HeyBishop

    Joined:
    Jun 22, 2017
    Posts:
    238
    Thank you! Your advice is very helpful!
     
    Malbers likes this.
  17. KeithBrown

    KeithBrown

    Joined:
    Apr 1, 2017
    Posts:
    191
    Researchers for the Massachusetts Turnpike Authority found over 200 dead crows near greater Boston recently, and there was concern that they may have died from Avian Flu.

    A Bird Pathologist examined the remains of all the crows, and, to everyone's relief, confirmed the problem was definitely NOT Avian Flu. The cause of death appeared to be vehicular impacts.

    However, during the detailed analysis it was noted that varying colors of paints appeared on the bird's beaks and claws.

    By analyzing these paint residues it was determined that 98% of the crows had been killed by impact with trucks, while only 2% were killed by an impact with a car.

    MTA then hired an Ornithological Behaviorist to determine if there was a cause for the disproportionate percentages of truck kills versus car kills.

    He very quickly concluded the cause: When crows eat road kill, they always have a look-out crow in a nearby tree to warn of impending danger.

    They discovered that while all the lookout crows could shout 'Cah', not a single one could shout 'Truck.'
     
  18. GingerDr73

    GingerDr73

    Joined:
    Sep 25, 2013
    Posts:
    21
    I'm having some issues with the AI script. Essentially it appears to be teleporting creatures when the should be moving normally. The video below shows the issue.

    https://1drv.ms/u/s!ApAXRg6XkYNzic9uem0kh_qF6KxnaA

    What's happening from a code point of view I'm just assigning a position within that circle/sphere as the destination using SetDestination() on the AI control script. Once within there the creature eats, waits for that to be done then tries to find a position ahead of it within the circle/sphere. If it gets a valid position ahead of it the creature will move to that, if not it picks a random spot within the circle. The problem usually happens when the creature gets a valid position ahead of it, these positions are on the navmesh and further away than the creature's stopping distance. Yet it will always just teleport to them instantly. I've been looking at my own code and the AI control script for ages and I have no idea what is happening. The teleport can also send the creature straight through the terrain in some cases as well.
     
  19. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    I've try to teleport the animal with no luck using the Point Click example which uses SetDestination() . even when an action is playing.......

    you can ask the animal which type of animation is playing... if is an Action, Locomotion, Fly , Idle ... etc using the Animations state tags...

    you can know using this:
    Code (CSharp):
    1. if (animal.CurrentAnimState == AnimTag.Action)
    2. {
    3. //Do not move the animal
    4. }
    so if the Animal is on an Action animation you should not try to move it to the next location....

    AnimTag class store all the Hash value for the Tags on the Animation states on the animator
     
    GingerDr73 likes this.
  20. GingerDr73

    GingerDr73

    Joined:
    Sep 25, 2013
    Posts:
    21
    Well I gave it a try, unfortunately all I got is the animal is always in idle state when it does these unintended teleport moves or any of the other moves. I had a bit more of a play with the Point Click example as well and went over my code again but I haven't uncovered anything further. It's getting late here though, I'll have a look with fresh eyes tomorrow.

    Cheers :)

    EDIT:
    Played around with it a bit more, got it fixed not 100% certain but pretty good. Fairly sure the problem was nothing to do with your setup, I think it was caused by feeding it invalid positions that my code was generating.
     
    Last edited: Jun 18, 2018
    Malbers likes this.
  21. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
  22. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,296
  23. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    its Ready!!
    Jut let me create a bunch of textures and some blend shapes so you guys can have a lot of variety.... :D :D
    like this:




    this last one is not a crow/raven but what the heck I can hav it from the same model :D :D
     
    Rowlan and Hitch42 like this.
  24. SgtMeowMerrs

    SgtMeowMerrs

    Joined:
    Jun 19, 2018
    Posts:
    2
    Hey Malbers, I'm using your Fox pack, and I wanted to know if there was an easy way of making the AnimalAIControl script update the position of the target so that the entity using the script would see the target change position and update direction accordingly.
     
    HeyBishop likes this.
  25. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    I noticed that too... I have fixed so if the targets moves the Animal AI controls check again the new target position

    here's the fix :)
    Cheers
     

    Attached Files:

    HeyBishop likes this.
  26. SgtMeowMerrs

    SgtMeowMerrs

    Joined:
    Jun 19, 2018
    Posts:
    2
    That works perfectly! Thank you Malbers :)
     
    Malbers likes this.
  27. KeithBrown

    KeithBrown

    Joined:
    Apr 1, 2017
    Posts:
    191
  28. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    KeithBrown likes this.
  29. argh6543

    argh6543

    Joined:
    Apr 14, 2017
    Posts:
    48
    Great work! I just started a new project and your creations are just what I needed.

    I've run into one issue though. I have UI elements that the user needs to click and the animal takes the left click as Fire1. I usually use EventSystem.IsPointerOverGameObject to handle that and InputRow GetInput seems like a logical place. Can you think of a better way to handle this?

    Thank you.
     
  30. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    yes! the logical place to put it is on the malbers input script :D

    I will added for the next updates :)
     
  31. KeithBrown

    KeithBrown

    Joined:
    Apr 1, 2017
    Posts:
    191
  32. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    They are converted in Json...
    here's the Asset :)
     

    Attached Files:

  33. KeithBrown

    KeithBrown

    Joined:
    Apr 1, 2017
    Posts:
    191
    aaaahhhh! I just starting working with Behavior Designer and Node Canvas and didnt know about the json import/export functionality of Node Canvas. I imported the json and got it working.

    Interesting node tree. I was expecting some custom nodes to drive the bunny but instead the author cleverly used your existing AI class and just drove the target of that class instead. Smart thinking.
     
    Kaen_SG and Malbers like this.
  34. argh6543

    argh6543

    Joined:
    Apr 14, 2017
    Posts:
    48
    Wow, thank you! Based on what I've seen from other assetstore publishers, I expected a two word reply a week from now - not this. Thank you again!
     
    Malbers likes this.
  35. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
  36. Mustakaapu

    Mustakaapu

    Joined:
    Nov 19, 2017
    Posts:
    3
    Can we have the awesome cougar on unreal marketplace also? ;)
     
    Malbers likes this.
  37. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    I will upload him and the moose this month..... :D

    Sorry I have being a bit away... I'm having a few problems with my work visa but hopefully I will be working full time again very soon
     
    Mustakaapu likes this.
  38. argh6543

    argh6543

    Joined:
    Apr 14, 2017
    Posts:
    48
    I've just run into an issue with the wolf digging animation - it never seems to stop. I checked the demo scene as well, same behavior. Comparing the wolf with the bear animations, the Dig state is missing the LoopBehavior. Adding that in, fixes my issue.
    Was that an oversight, or am I missing something on my side?

    Thank you!
     
    Malbers likes this.
  39. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    it seem I forgot to set the loop behaviour there :) .... the solution is that one .... thanks for catching that bug!!
     
  40. R1PFake

    R1PFake

    Joined:
    Aug 7, 2015
    Posts:
    542
    A while ago you posted something about wyvern and crystal dragon models, do you have any update/news about these?
     
    Malbers likes this.
  41. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    Yes I do :)
    28235823_1570769296322185_1926130678_n.png 35701566_1687909601274820_3174726047224561664_n.jpg 35788253_1687928247939622_2760340451385933824_n.jpg 36362019_1706481682750945_5518968387641802752_n.jpg 36585535_1706214236111023_9102073458811994112_n.jpg

    Also Also here's the Raven and Crows SketchFab (it should be out this week) :D
     
    R1PFake and Rowlan like this.
  42. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
  43. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,296
    It's out and already purchased. It's awesome :D
     
  44. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    GingerDr73 likes this.
  45. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,296


    More of those realistic animals please :)
     
  46. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    They will keep coming!!!

    BTW im working on adding some audio to the ravens/crows :D
     
    DarkUnykorn, Virtuadreamer and Rowlan like this.
  47. GingerDr73

    GingerDr73

    Joined:
    Sep 25, 2013
    Posts:
    21
    Hi Malber, Just added the ravens to my project and I noticed after the upgrade a bunch of my AI land creatures (Forest Pack) are ignoring their navmeshagents. Using the debug mode of the AnimalAIControl script I can clearly see where they should be going but they just don't move that direction. The agents themselves are active and I haven't changed anything else in my setup. The land creatures usually work fine initially, it might be happening after they sprint.

    1/4

    2/4

    3/4

    4/4







    In these images you can see the NavMeshAgents want to go off in different directions but the deer just keep going straight ahead. My AI scripts just pass destination Vector3s or Transforms to the AnimalAIControl script using the appropriate functions. The only other interaction I have with those scripts is toggling the autospeed and forcing certain speeds at some points such as sprinting when fleeing or walking when grazing.

    EDIT: Fixed pictures, hopefully
     
    Last edited: Jul 15, 2018
    Malbers likes this.
  48. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    Try Upgrading also all the animals you have.... I have made some changes to their animators and the Animal Script...

    also the the WayPoints now you can go from one WayPoint to a random Next Target and wait a random x time (that way you can simulate some kind of wandering behaviour
     
    KeithBrown likes this.
  49. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    thaomoua, Weblox and Rowlan like this.
  50. 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