Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

[RELEASED] Emerald AI 2.4.1 - The Ultimate Universal AAA Quality AI Solution

Discussion in 'Assets and Asset Store' started by BHS, Jun 26, 2015.

  1. dsilverthorn

    dsilverthorn

    Joined:
    May 14, 2017
    Posts:
    484
    It is a little tricky at first, but you were in the right place.
    Look under
    Detection & Tags
    Tag & Faction Option
    Faction Options
    scroll down to bottom under Player Relations and you will see
    AI Faction Relations
    click on '+' sign and it will pop up with the drop down menus.

    A piece of cake ;)
    Good luck!
     
  2. CodexofRome

    CodexofRome

    Joined:
    Oct 11, 2015
    Posts:
    41

    So here's the screen that I see. As you'll note, the AI Faction Relations shows no + to add to the list. In fact, this entire page seems to run off the right side of the screen, whether maximized or minimized. Other pages show the same thing, but some pages, for example the Items tab under AI Settings does show a + where you can add to the Item Object list.

    I wonder if this log note when I reopened my project today may be related. It reads:
    Code (csharp):
    1. The editor layout could not be fully loaded, this can happen when the layout contains EditorWindows not available in this project UnityEditor.WindowLayout:LoadDefaultWindowPreferences()
    This apparently has been observed by others for several years. It is currently listed in the Unity Issue tracker for 2020 versions of Unity. [https://issuetracker.unity3d.com/is...d-message-is-shown-when-the-project-is-opened]

    FWIW, I'm using 2019.3.7f1. I have reset my layout using Window/Layouts/Revert Factory Settings, but that didn't fix the problem. I've tried some other suggestions discovered via the Google, but no luck there either. Fortunately, I've got time and plenty of other work to do on my project.

    EDIT: Update, I found it. But I had to squeeze the Inspector window to it's minimum size and the + showed up. If I widen the Inspector window the + falls out of the right side of the screen and disappears again. The same behavior can be see in the AI Settings/Combat/Damage Settings page.
     

    Attached Files:

    Last edited: May 17, 2020
  3. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

    Joined:
    Dec 13, 2017
    Posts:
    315
    when i make my ai companions then use change behavior my ai will die but not display the death event they just carry on walking around (only does this if i change from companion to passive/cautious). Is their a workaround for this ?
     
  4. sebasfreelance

    sebasfreelance

    Joined:
    Aug 27, 2015
    Posts:
    227
    Greetings, see if you can help me

    he setup a soldier following the next tutorial ... https://github.com/Black-Horizon-Studios/Emerald-AI/wiki/Creating-a-Shooter-AI

    Everything works well for me, the enemy detects the player, shoots him, flees, searches for me, etc ... but for some reason the projectiles go through the walls, do you know why?

    in physics, I have the whole matrix active, the projectile should hit the wall.

    Thanks in advance!
     
  5. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,828
    have you tried setting the Rigidbody Collision Detection to Continuous or Continuous Dynamic?
     
  6. CodexofRome

    CodexofRome

    Joined:
    Oct 11, 2015
    Posts:
    41
    Working my way through setting up my various AIs and I've a couple of questions.

    1) Once I've got everything set up the way I want for one creature, what's the best way to create multiple versions in a scene? Can I just make a prefab out of the enemy that I've finished?

    2) Combat Text... I can see the damage numbers, but I don't see name, title or health bars. How can I fix that?

    Thanks in advance for any help you can provide.
     
  7. SickaGamer

    SickaGamer

    Joined:
    Jan 15, 2018
    Posts:
    994
    Yes. Once you are done and have an enemy complete, you can drag it to a folder and create a prefab of it. Then you have it saved for future use and just drag them onto the scene. You can also highlight the AI Prefab and hit Ctrl + D to duplicate it.
     
  8. sebasfreelance

    sebasfreelance

    Joined:
    Aug 27, 2015
    Posts:
    227
    had the wall in Static! ;)
    thanks for answering!
     
  9. CodexofRome

    CodexofRome

    Joined:
    Oct 11, 2015
    Posts:
    41
     
  10. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,259
    Are you using the swimming plugin? If so, I'm not sure why it wouldn't be working as I didn't create it.
     
  11. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,828
    I already worked out how to fix his issue. It was because I had programmed the script to use an Emote for the swimming animation and for some reason EmeraldAI doesn't allow the companion to follow when running an emote. So, I ended up using a Playable instead. All is sorted out now.
     
    unity_7UFP4-iCkwsgjg likes this.
  12. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,259
    This is issue was fixed awhile back. Can you confirm you are using the newest version of Emerald AI, version 2.4.0.1?

    If you are receiving that Unity error and it is a known issue, it most likely is an internal issue on Unity's end. You can try rescaling the editor though to see if it helps.

    Open up the EmeraldAIEditor script and find all instances of both:
    Code (CSharp):
    1. 87 * Screen.width / Screen.dpi
    2. 85 * Screen.width / Screen.dpi
    And change them to:
    Code (CSharp):
    1. 80 * Screen.width / Screen.dpi
    This should scale things smaller so you can properly see the editor. I have not encountered this issue yet and it's the first time I've heard of it since it's been fixed so I'm not sure what exactly is causing it, but I will look for a proper solution.
     
  13. CodexofRome

    CodexofRome

    Joined:
    Oct 11, 2015
    Posts:
    41
    Thank you. That did the trick. The version I have installed is 2.4.0.1. It's Unity 2019.3.13f1 Personal.
    My other question was about the Combat Text.. I see damage numbers, but I don't see the name, title or health bars. I think my problem must lie in the tags and layers I'm using.
     
    Last edited: May 19, 2020
    dsilverthorn likes this.
  14. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,259
    Great to hear that fixed it.

    The UI for individual AI is enabled through the UI Settings tab for each AI. Here, you can enable the display of the AI's name, health bar, and level.
     
  15. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

    Joined:
    Dec 13, 2017
    Posts:
    315
    @BHS my ai carries on attack my other ai even if their dead any way around this?
     
  16. FractalCore

    FractalCore

    Joined:
    May 15, 2009
    Posts:
    146
    Emerald AI seems to be set up to cater to magic games. I followed the "Creating a Shooter AI" tutorial on getting ranged attacks going and it talks about using the Cast Effect and Collision Effect within an Ability to do a muzzle flash and impact effect. However...

    The muzzle flash doesn't align to the direction the gun is pointing and the impact effect doesn't align to the surface it hits (should shoot out perpendicular to surface). They're only omni-directional. Is there a setting I missed about aligning them?

    How about raycast attacks? I'm guessing you could add a new Raycast entry into the "Ability Settings", "Damage Type" drop-down box.
     
    Last edited: May 22, 2020
  17. franky_li

    franky_li

    Joined:
    Aug 8, 2016
    Posts:
    157
    I have a problem with Unity 2019.3.13f1, when I build an AI I get following error and the inspector GUI is messed up:
    NullReferenceException: Object reference not set to an instance of an object
    EmeraldAI.Utility.EmeraldAIEditor.OnInspectorGUI () (at Assets/Emerald AI/Scripts/Editor/EmeraldAIEditor.cs:1459)

    How can I fix this?
     
  18. franky_li

    franky_li

    Joined:
    Aug 8, 2016
    Posts:
    157
    Reimport fixed it!
     
  19. chrisk

    chrisk

    Joined:
    Jan 23, 2009
    Posts:
    690
    BHS,
    Hm... I've just looked at EmeraldAI code just now and I was very surprised how it is written.
    The code is one gigantic monolithic piece of if.. else if.. else if.. just like how we used to code C before C++ existed.

    The biggest problem is that it's is very difficult to extend the system unless you use exactly how it is designed.
    As you may well know, there is no silver-bullet for AI and I think you might reconsider adopting OOP style for various kinds of AI so that we can easily extend it.

    Emerald AI has many cool features but as is, I don't think I can use Emeral AI beyond just simple prototypes.

    I'm not sure how fast Emerald AI has been evolving, but I'm sure it will help you to add new features faster too.

    My two cent.
     
  20. Deckard_89

    Deckard_89

    Joined:
    Feb 4, 2016
    Posts:
    279
    It seems the IK "Head Look" feature still activates even if the player has not been seen by an AI. This is confusing for the player, if trying to implement stealth mechanics.
     
  21. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,259
    Well, if it's not if else, then it's switch statements. There's only a handful of conditional statements. I'm always willing to improve my code and I've done various code refactoring over the course of developing Emerald AI. It's not as black and white as just updating the code to an OOP style, which I'm well aware of. I have thousands of users who use Emerald AI and an update like that would most likely break their existing projects. I am planning on another code refactor to update Emerald AI's code to be more extensive and customizable with a future update. Emerald AI has tons of API that can be accessed to add a lot of functionality and customization. Users can also use Emerald AI events that are invoked during various actions.
     
    llJIMBOBll likes this.
  22. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,259
    Are you receiving any errors? AI should stop attacking once an their target dies and either move the next target or return to their behavior.
     
  23. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,259
    Did you setup a custom weapon transform? The muzzle flash should align to its direction. I have plans to add raycasts as an option for bullets with the next update. I can also add options to choose the alignment direction of the effects with the next update.
     
  24. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,259
    I wasn't aware of this. I'll be sure to fix it with the next update.
     
    Deckard_89 likes this.
  25. sky_dragon

    sky_dragon

    Joined:
    May 27, 2016
    Posts:
    25
    Hello
    If you are free, please reply to the questions of the Crux forum. Thank you
     
  26. Lex_Vector

    Lex_Vector

    Joined:
    Sep 30, 2015
    Posts:
    3
    I've been having a similar problem. Not sure if this helps but, for me it was a parenting issue. Player health goes on primary parent with the biggest collider, even in VR where you may be disinclined to do that..
     
  27. AdminArdagor

    AdminArdagor

    Joined:
    Feb 6, 2018
    Posts:
    39
    I can’t understand what’s the matter .. After playing the hit animation, the function HeadLock starts to work incorrectly for me: the unit loses its original direction of looking at the player and starts to look off to the side ... how can this be fixed?
     
  28. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,259
    I've replied. :)
     
  29. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,259
    Thanks, I'll look into this.
     
  30. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,259
    If possible, I would need a video of the issue to better understand what's happening. I'm not sure if this is related, but the Head Look feature is based off of the forward position of the AI. If an AI's animation rotates their body, it alters the angle of the head look feature to be calculated based off of the modified position according to he current animation. I'm working on addressing this soon. For now, you can try increasing the head look angle for combat to see if it helps.
     
  31. Garraty16

    Garraty16

    Joined:
    Mar 26, 2019
    Posts:
    2
    Hey there!

    So, yesterday I've purchased this Asset, and in general it's looking good. I've managed to setup an "Agressive Foolhardy" bear, and it's working alright in general.

    The problem for me is that when I try to setup the "Cautious Coward" deer, it won't run away from me, Instead it's attacking! I've recorded an explanatory video to you to show the issue. Besides, "Passive Coward" is throwing an exception to me. Here's the video:


    Besides sounds for "Attack" effect are not working for me (bear), and when I unset an attack (why would a cautious coward need this??), the exception is thrown:


    [Update]There's a workaround for the bear's attack sound to put PlayAttackSound into Animation, so this issue is rather minor, don't pay much attention to it[/Update]

    I'm using the latest version of your asset: 2.4.0.1 with Unity version is 2019.3.15f1.

    Please help me to resolve these issues or advise me what am I doing wrong?
    For faster communication I'm available at discord: garraty#0765 if needed.

    Looking forward for your response!
     
    Last edited: Jun 9, 2020
  32. Nitrox32

    Nitrox32

    Joined:
    May 9, 2017
    Posts:
    128
    For some reason the integration with Invector is not completely working. I have gone through the tutorial many times. I am able to deal damage but not receive it. My character is not using a weapon, just fists. I uncommented the DamageInvectorPlayer line at 2:27 in your video(I missed this the first time). I have the animation events set to SendEmeraldDamage. I've check my layers and they match the tutorials. Any thoughts?
     
    Last edited: Jun 10, 2020
  33. AdminArdagor

    AdminArdagor

    Joined:
    Feb 6, 2018
    Posts:
    39
    Here is a video showing the problem: after a few strokes, the head loses its orientation to the player



    Angle Limit = 90
     
  34. Nitrox32

    Nitrox32

    Joined:
    May 9, 2017
    Posts:
    128
    I was able to get it working by changing the child tag of my Invector character to Ungagged and its layer to Ignore Raycast (yes, change the children). Someone on Discord said that another solution involved a setting the Invector Melee Manager. I'd kinda like to know the setting since there would be less confusion with the Emerald AI solution.
     
    Last edited: Jun 11, 2020
  35. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,259
    Hey there!

    The issue with the deer is very strange. I have tested this with several AI and all of them act properly when set to Cautious Coward. I have no idea why the deer is attacking you instead of fleeing. Is there a possibility that there may be a script somewhere changing its behavior?

    Attack sounds are added through an Animation Event as explained here: https://github.com/Black-Horizon-St...nimation-Events#attack-sound-animation-events but it sounds like you've figured that out. This allows them to play at the right frame rather than just playing when the animation starts.
     
    Garraty16 likes this.
  36. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,259
    Were you able to resolve this? I believe I told you my suggestion on Discord to use a child dummy object for the player. I'm not aware of the melee manager setting. Also, the damage animation event has been update to EmeraldAttackEvent. I would recommend using this instead of SendEmeraldDamage.
     
  37. SickaGamer

    SickaGamer

    Joined:
    Jan 15, 2018
    Posts:
    994
    @BHS what's in store for the next update and when is it!?
     
  38. Rahd

    Rahd

    Joined:
    May 30, 2014
    Posts:
    315
    @BHS
    Great Update the 2.4 !!
    works like a charm!
    a couple of suggestions :

    1- Animator.MatchTarget , when I added this on the run Attack there Was A huge improvement, (a random example )

    2-Reload or Charge Animations, before attacking, using melee the Ai will play a Recharge animation, if interrupted, by getting hit or target is too far, the Attack with the charge option will be interrupted, Same goes for the Ranged Attacks, Guns have a number of bullets, and Bows need arrows. and magical monsters need to charge their spells.

    2-Dodge :
    make the Ai roll, Strafe, jump to the left or right, when the Ai takes Damage or When the Ai is being Targeted like when the Ai opposing enemy AI Targeting Raycast is hitting the AI that has Dodge on, and it's about to Attack the AI will Dodge.
    3-Teleporting :
    Make the Ai teleport with a condition , like getting hit or enemy is too close, the Ai Will chose a random position on the navmesh, play a teleporting animation and VFX, teleport to the random position and play the Arrival animation and VFX.
    4-cooldown animation, those can play after a Run attack, or energy(stamina) too low. having the attacks cost Stamina will be a great addition, instead of running Attack bases on order , random or odds.
    5-Ranged Attack could use multiple projectiles on one single attack, or multiple projectile spawn points . this would work for dual guns or rocket Sam site Turret for example.
    6-Ram the player or enemy, and damage or stun the target or both. The run attack is great !!, but a ram Attack will keep driving the AI into the same Direction until the Ram attack Timer is over.
    7-Confuse The Target, this is basically a Teleport, Run or jump, to Random positions Around the Target very fast.
    8- Area Attack, when the ai uses this, It will for example Slam The ground, create A gas cloud, or explode on a certain Area when the player is too close.
    9- movements, using a Vector2 Direction (Directionx and Directiony on the animator) will Allow 8-way Movements for a Fluid Walk and Run Cycles.

    10- behavior node editor! Doing this will propel the Ai to a Godly stats on the asset Store, the Provided behaviors are really good, but to make your own using nodes will unleash the true potentials of this AI, I had a really hard time doing this mostly due to the absence of modular Functions, and the node editor examples on Github are buggy and confusing.
    11- Add more Attack animation Slots, 6 Attack animation was not enough.


    I have added some of those suggestions to my project, Vector 2 Direction, Teleport using the Event System you have placed, cooldowns, Area attacks using Animator StateMachineBehaviour script, some of the Ranged Attack things, Reload or Charge Animations.


    I'm Still Struggling with The dodge , Confuse , Ram, and whatever is left on that list.

    I really appreciate the great work it's been put into this asset, I know some of my suggestions are specialized :(. So take them not so seriously:p. if you can add any of those suggestions I will be a very very happy customer. because I'm already very happy.

    Edit :
    for some reason CurrentAnimationClip = AIAnimator.GetCurrentAnimatorClipInfo(0)[0].clip; on the EnemyNPCAISystem --->Update() will throw a null errors sometimes ( change the animator by hand , or pause the runtime )

    Code (CSharp):
    1.     if (AIAnimator.GetCurrentAnimatorClipInfo(0).Length  >0 )
    2.                 CurrentAnimationClip = AIAnimator.GetCurrentAnimatorClipInfo(0)[0].clip;
    should fix it
     
    Last edited: Jun 16, 2020
    AdminArdagor likes this.
  39. Garraty16

    Garraty16

    Joined:
    Mar 26, 2019
    Posts:
    2
    Hey!

    Thank you for the response!

    I have no idea what was wrong with that deer - I've created a chicken instead, and it's fleeing nicely. Maybe that deer is just too proud to run, I don't know, lol. Thanks anyway.

    Btw, how would you implement a behavior for your AI so that when it reaches a static destructible building, it may start to attack it and then occasionaly break it? Should I just assign an appropriate layer / fraction to the destructible object so that AI considers them as enemies?
     
  40. iohouse

    iohouse

    Joined:
    Jul 15, 2014
    Posts:
    6
    Hi, is Pegasus by Procedural Worlds a complementary product to Emerald AI, or are they more competing in features? Sorry if this wasn't obvious for me to determine; the feature set between the two are quite numerous and I don't have experience with either one yet but evaluating for my next project.

    My need is to have enemy NPC follow a path to a target but be able to wander off that path to melee attack any nearby targets and then return to the path afterward. So, my thought was to have the overall NPC path to the target being executed by Pegasus and the melee attack to nearby targets executed by Emerald AI.

    Thanks
     
  41. jamesccc

    jamesccc

    Joined:
    Nov 17, 2012
    Posts:
    5
    Hi, i am new to Emerald AI, may i know if how to integrate Emerald AI with Action RPG starter Kit?
    Thanks.
     
  42. ChoChick

    ChoChick

    Joined:
    Jul 18, 2016
    Posts:
    39
    I'm trying out Needs System.
    I set the setting to Cautious & Coward in order to set the AI of the cowardly rabbit.
    When AI is set to Cautious & Coward, NullReferenceException error occurs in EmeraldAISystem.cs:2276 when KillAI() is called with Depleted Resources Kill[Yes].

    --- Edit ---
    I was able to prevent the error by changing the ConfidenceType to Brave before calling KillAI().
     
    Last edited: Jun 19, 2020
  43. Dunmord

    Dunmord

    Joined:
    Aug 15, 2013
    Posts:
    37
    I recently got EmeraldAI and good work overall! I have been playing with the Needs System and have a few questions/feedback.

    * How can I add an extra condition for the AI to start gathering/not gathering things? In my game the AI should only gather resources if it has enough gold (another resource) to purchase such items. How can this be expanded for that?

    * How can I differentiate between multiple resources? Different items will have different prices, so gathering "healing potions" is going to have a different condition than gathering "mana potions".

    * Could we add an API ConsumeResource()? So that we can consume the resource instead of it being depleted over time by itself?
     
  44. ash4640

    ash4640

    Joined:
    Jan 19, 2018
    Posts:
    59
    I have purchased the asset and I want to build a small RPGs system where the combat is a 3rd person melee based attack etc. But I want to set up a simple turn based combat system. Is that possible with this system. I have Invector 3rd person controller and dialogue system.
     
    Last edited: Jun 19, 2020
  45. Rahd

    Rahd

    Joined:
    May 30, 2014
    Posts:
    315
    Hi everyone Not sure if this was added But here is how you make your Ai jump For very little code using Navmesh Links For root motion AI Only, I will update the navmesh driven on soon :


    1-Create this StateMachineBehaviour script Named EnemyAiJUMPState
    Code (CSharp):
    1. public class EnemyAiJUMPState : StateMachineBehaviour
    2.     {      
    3.      
    4.  
    5.      
    6.         [Range(0, 1)]
    7.         public float Endtime = 0.8f;
    8.  
    9.      
    10.  
    11.         public    EmeraldAI.EmeraldAISystem EnemyNPCAIvar ;
    12.  
    13.  
    14.         public override void OnStateEnter(Animator animator, AnimatorStateInfo animatorStateInfo, int layerIndex)
    15.         {    EnemyNPCAIvar =animator.transform.GetComponent< EmeraldAI.EmeraldAISystem>();
    16.               hasended = false ; // this to reset the bool end
    17.  
    18.         }
    19.  
    20.    
    21.  
    22.         bool hasended = false ; // this is to keep the state from calling the endjump everyframe  
    23.  
    24.         public override void OnStateUpdate(Animator animator, AnimatorStateInfo animatorStateInfo, int layerIndex)
    25.         {
    26. // we check the animation time if it's at the end time , please set this lower than 0.95  change according   to your animation
    27.             if (animatorStateInfo.normalizedTime >= Endtime && !hasended) {
    28.                 hasended = true;
    29.                 Debug.Log ("end");
    30.                 EnemyNPCAIvar.EndJump (); // this will reset all the jump variables and get back to walking or running .
    31.  
    32.             }
    33.  
    34.  
    35.         }
    36.  
    37.         override public void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) {
    38.             EnemyNPCAIvar.EndJump (); incase the timed endjump did not work  we end the jump again .
    39.         }






    2-Add this State inside the Animator :


    upload_2020-6-19_14-3-51.png

    and put your Jump Animation
    Jump animation clip should have those settings :
    upload_2020-6-19_14-6-21.png

    now click the Jump State and click Add behaviour
    and add EnemyAiJUMPState script

    3-Add those parameters to the animator :
    Trigger called "Jump"
    Bool called "IsJumping"

    4- head To the EmeraldAISystem script and find MoveAIRootMotion()
    Add those Variables and Function Above it :

    Code (CSharp):
    1. bool isjumping=false;
    2.         public void EndJump (){
    3.             isjumping = false;
    4.             m_NavMeshAgent.CompleteOffMeshLink(); // complete the path to avoid jumping again on the same path  
    5.             m_NavMeshAgent.autoTraverseOffMeshLink = true; // back to using paths
    6.  
    7.             m_NavMeshAgent.isStopped = false; // activate the navmesh agent
    8.             AIAnimator.SetBool ("IsJumping", false);  // exit the animator state of jump
    9.      
    10.         }
    5- inside MoveAIRootMotion find those lines (should be 3 repetitions )
    Code (CSharp):
    1. AlignAIMoving();
    2.                             AIAnimator.SetFloat("Speed", speed, 0.3f, Time.deltaTime);
    3.                             AIAnimator.SetFloat("Direction", angle, DirectionDampTime, Time.deltaTime);
    and replace it with :

    Code (CSharp):
    1.     if (m_NavMeshAgent.isOnOffMeshLink) {
    2.  
    3.                             OffMeshLinkData data = m_NavMeshAgent.currentOffMeshLinkData;
    4.  
    5.                          
    6.                             if (!isjumping   ) {
    7.                              
    8.                                 AIAnimator.SetTrigger ("Jump");
    9.                                 isjumping = true;
    10.                                 m_NavMeshAgent.isStopped = true;
    11.                                 m_NavMeshAgent.autoTraverseOffMeshLink = false;
    12.                             }
    13.  
    14.                             AlignAIMoving();
    15.                             AIAnimator.SetFloat("Speed", speed, 0.3f, Time.deltaTime);
    16.                             AIAnimator.SetFloat("Direction", angle, DirectionDampTime, Time.deltaTime);
    17.  
    18.  
    19.                         } else {
    20.                          
    21.                             AlignAIMoving();
    22.                             AIAnimator.SetFloat("Speed", speed, 0.3f, Time.deltaTime);
    23.                             AIAnimator.SetFloat("Direction", angle, DirectionDampTime, Time.deltaTime);
    24.                          
    25.                             isjumping = false;
    26.                             m_NavMeshAgent.CompleteOffMeshLink();
    27.                             m_NavMeshAgent.autoTraverseOffMeshLink = true;
    28.  
    29.                             m_NavMeshAgent.isStopped = false;
    30.                             AIAnimator.SetBool ("IsJumping", false);
    31.  
    32.                         }
    6-When you bake the navmesh add some jumping distance and drop Height
    upload_2020-6-19_14-16-27.png

    if you want a flat surface jumping, add a navmesh link script found here : (https://docs.unity3d.com/Manual/NavMesh-BuildingComponents.html)
    to know that the baking is ok you should have those arrows and circles.
    that should be All I think unless I forgot something else, let me know. I will update this to cover different jump distances and a max jump distance.



     
    Last edited: Jun 19, 2020
    Deckard_89 and magique like this.
  46. Rahd

    Rahd

    Joined:
    May 30, 2014
    Posts:
    315
    hey forgot to add the jump state transitions (there is a limit on the images I can share in one post):
    PS : edit the Exit time based on your animation
    upload_2020-6-19_16-26-26.png
    from jump to combat move ranged :
    upload_2020-6-19_16-20-57.png
    from jump to movement :
    upload_2020-6-19_16-21-20.png
    from jump to combat movement :
    upload_2020-6-19_16-21-37.png
    from anystate ( the green one )to jump (use the jump trigger on this one ) :
    upload_2020-6-19_16-22-11.png
     
    LVelior and AdminArdagor like this.
  47. Rahd

    Rahd

    Joined:
    May 30, 2014
    Posts:
    315
    Added this to the editor script with 3 different animations for jump, might add climb and other stuff. export works, it's like any other tab .
    upload_2020-6-20_19-4-10.png
    Big thanks for the clean Scripts , it was very easy to add this .
     
    Last edited: Jun 20, 2020
    LVelior and AdminArdagor like this.
  48. ChoChick

    ChoChick

    Joined:
    Jul 18, 2016
    Posts:
    39
    If an aggressive AI wants to stop Combat under certain conditions, is there a function to stop Combat or look for the target again to attack?
    --- Edit ---
    I found EmeraldAIBehaviors.DefaultState().
    Thank you.
     
    Last edited: Jun 22, 2020
  49. Rahd

    Rahd

    Joined:
    May 30, 2014
    Posts:
    315
    Here is Something I added Today.
    TLDR: This Tab will handle Sounds Special Attacks like Toxic Clouds, Fire pool, Breath Fire.
    And Probably anything you want Like, Jump Land, feet steps, Fire Eyes ... teleport.


    upload_2020-6-22_15-0-46.png
     
    LVelior likes this.
  50. SickaGamer

    SickaGamer

    Joined:
    Jan 15, 2018
    Posts:
    994
    Nice. That would be sweet for @BHS to add
     
unityunity