Search Unity

[RELEASED] Emerald AI 3.2 (New Sound Detection) - The Ultimate Universal AAA Quality AI Solution

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

  1. Deckard_89

    Deckard_89

    Joined:
    Feb 4, 2016
    Posts:
    316
    @BHS Okay, I have enabled all Debug tools and no targets or obstructions are being logged.
    Also, according to the documentation for draw raycasts: "A green line indicates that the AI's sight is not obstructed. A red line indicates that an AI's line of sight is obstructed." But my AI's raycast line is yellow.

    This was working fine before the update - is there something else that needs to be reapplied or whatever? I have done all animations and attacks.
     
  2. Deckard_89

    Deckard_89

    Joined:
    Feb 4, 2016
    Posts:
    316
    It's definitely LoS related because if I set it to trigger detection it works immediately.
     
  3. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Strange, I will look into this right now.
     
  4. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    I've tested this and the AI detect their targets right when they are with their LoS. Have you reapplied your AI's factions to their faction relation list? This is required due to the new faction system with 2.4.
     
  5. Deckard_89

    Deckard_89

    Joined:
    Feb 4, 2016
    Posts:
    316
    Yes, your demo scenes are working too. Not sure what's wrong.
    How about my AI's raycast line being yellow instead of green or red? What does this mean?

    EDIT: Also have you tried with stationary (but still aggressive and foolhardy) AI?
     
  6. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    I've updated the Emerald AI Wiki to explain the other colors. The yellow line is used for the AI's line of sight to its look at target, when using the Head Look feature. An orange line is cast for each target within an AI's detection radius until they are visible by the AI, when using the LoS feature. I have tried the Stationary Movement Type and everything is working correctly on my end.

    Are you using custom faction names? I've discovered a bug with 2.4 that sometimes doesn't allow the Faction Data to sync correctly. Is your Faction Manager data and your AI's faction enums displaying the same faction names? I have a fix that will be submitted today to address this.
     
  7. Deckard_89

    Deckard_89

    Joined:
    Feb 4, 2016
    Posts:
    316
    @BHS No, all I am using is creature faction and then the player.

    I think I may have solved it though. I am using Unity's Character Controller to control my player instead of a Rigid Body. I added an additional collider and then LoS detection worked. It seems that the capsule collider used on the character controller isn't detected by Emerald like a normal collider is, even though they are the same layer.
    Not sure why it works up close though, and also why trigger works with character controller detection but LoS does not.
     
    Last edited: Mar 26, 2020
  8. ChromazoneX

    ChromazoneX

    Joined:
    Mar 13, 2019
    Posts:
    12
    On that note of Factions, I've been trying to setup Avoidance for my AI's using Factions and putting them all in one faction. The goal is to have them attack the player which they do, but to keep it a first come first serve basis so the player isn't overrun with all the baddies at once and they will back off if they detect they are close to one another. But I can't get this to work.
     
  9. warthos3399

    warthos3399

    Joined:
    May 11, 2019
    Posts:
    1,745
    You can use the "too close" setting so they will back away, it works well. As far as the "first come first serve basis" you can use detection radius and behavioral settings, as line of sight wouldnt work well in that senario.
     
  10. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    The Character Controller Collider component doesn't work the same as other colliders so it's not going to be picked up by Emerald AI's detection system. Good to hear you were able to resolve this.
     
  11. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Hey everyone,

    Emerald AI 2.4.0.1 has been submitted and is awaiting approval. This small update fixes the issues introduced with version 2.4.0 as well as two new functions added to Emerald AI's Event Manager script.

    Fixes
    • Fixed an issue with the Run Attack Animation Event warning that would be displayed, even if the proper event was created.
    • Fixed an issue with the Faction Data not syncing or updating newly added factions properly.

    Additions
    • Added GetAIRelation(EmeraldAISystem EmeraldTarget) to the EmeraldAIEventsManager to get an AI's current relation to the EmeraldTarget relation.
    • Added GetPlayerRelation() to the EmeraldAIEventsManager to get an AI's current relation to the player.
     
  12. guerrero7

    guerrero7

    Joined:
    May 4, 2018
    Posts:
    3
    HI I HAVE THIS PROBLEM
    ArgumentException: UnpackPrefabInstance must be called with a Prefab instance.
    UnityEditor.PrefabUtility.UnpackPrefabInstance (UnityEngine.GameObject instanceRoot, UnityEditor.PrefabUnpackMode unpackMode, UnityEditor.InteractionMode action) (at <78f1ad0f25c84e3ca853e639f50d95f5>:0)
    EmeraldAI.Utility.EmeraldAISetupManager.OnGUI () (at Assets/Emerald AI/Scripts/Editor/EmeraldAISetupManager.cs:205)
    System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <437ba245d8404784b9fbab9b439ac908>:0)
    Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <437ba245d8404784b9fbab9b439ac908>:0)
    System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <437ba245d8404784b9fbab9b439ac908>:0)
    UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at <78f1ad0f25c84e3ca853e639f50d95f5>:0)
    UnityEditor.HostView.Invoke (System.String methodName) (at <78f1ad0f25c84e3ca853e639f50d95f5>:0)
    UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition, UnityEngine.Rect viewRect) (at <78f1ad0f25c84e3ca853e639f50d95f5>:0)
    UnityEditor.DockArea.DrawView (UnityEngine.Rect viewRect, UnityEngine.Rect dockAreaRect) (at <78f1ad0f25c84e3ca853e639f50d95f5>:0)
    UnityEditor.DockArea.OldOnGUI () (at <78f1ad0f25c84e3ca853e639f50d95f5>:0)
    UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <3736d7cfd1f845a5922f99478cb469e7>:0)
    UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <3736d7cfd1f845a5922f99478cb469e7>:0)
    UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <3736d7cfd1f845a5922f99478cb469e7>:0)
    UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Boolean canAffectFocus) (at <3736d7cfd1f845a5922f99478cb469e7>:0)
    UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUI (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus) (at <3736d7cfd1f845a5922f99478cb469e7>:0)
    UnityEngine.UIElements.IMGUIContainer.HandleEvent (UnityEngine.UIElements.EventBase evt) (at <3736d7cfd1f845a5922f99478cb469e7>:0)
    UnityEngine.UIElements.CallbackEventHandler.HandleEventAtTargetPhase (UnityEngine.UIElements.EventBase evt) (at <3736d7cfd1f845a5922f99478cb469e7>:0)
    UnityEngine.UIElements.MouseCaptureDispatchingStrategy.DispatchEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <3736d7cfd1f845a5922f99478cb469e7>:0)
    UnityEngine.UIElements.EventDispatcher.ApplyDispatchingStrategies (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, System.Boolean imguiEventIsInitiallyUsed) (at <3736d7cfd1f845a5922f99478cb469e7>:0)
    UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <3736d7cfd1f845a5922f99478cb469e7>:0)
    UnityEngine.UIElements.EventDispatcher.ProcessEventQueue () (at <3736d7cfd1f845a5922f99478cb469e7>:0)
    UnityEngine.UIElements.EventDispatcher.OpenGate () (at <3736d7cfd1f845a5922f99478cb469e7>:0)
    UnityEngine.UIElements.EventDispatcherGate.Dispose () (at <3736d7cfd1f845a5922f99478cb469e7>:0)
    UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <3736d7cfd1f845a5922f99478cb469e7>:0)
    UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at <3736d7cfd1f845a5922f99478cb469e7>:0)
    UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at <3736d7cfd1f845a5922f99478cb469e7>:0)
    UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <3736d7cfd1f845a5922f99478cb469e7>:0)
    UnityEngine.UIElements.UIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <3736d7cfd1f845a5922f99478cb469e7>:0)
    UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <817eebdd70f8402280b9cb11fff8b976>:0)
     
  13. theonerm2_unity

    theonerm2_unity

    Joined:
    Sep 7, 2018
    Posts:
    131
    I'm having a tough time trying to get this to work with horror fps kit. Any help is appreciated.
     
  14. AaronVictoria

    AaronVictoria

    Joined:
    Aug 21, 2010
    Posts:
    176
    @BHS, haven't received a follow-up about whether or not the stop and turn-to-face functionality has been added. I'm still running a little hack for that, but would like to know if you squeezed that in. I also found an issue with the logic in the CameraShake component and hacked in a little fix for that as well. The way it caches you init camera position before the shake occurs works well if a single shake is permitted to finish before another one starts. If a shake occurs while you're camera is already in the shake process, the new shake will cache your wobbled camera vector. So I just tossed in a quick bool to check "isShaking" and it updates to false only after the shake and camera reset are done.
     
  15. theonerm2_unity

    theonerm2_unity

    Joined:
    Sep 7, 2018
    Posts:
    131
    Hey guys I finally figured it out. I just had to script it in. I used the BH_Body to tell when the enemy was struck and I just used the attack animation on the enemy to tell when the Ai is attacking. Don't ask why I didn't just use animation for both.
     
  16. Mad_Mark

    Mad_Mark

    Joined:
    Oct 30, 2014
    Posts:
    484
    I am trying to setup my Companion AI's a little differently. My intentions are to have the AI's wandering around, and when they encounter the Player, they will fire up a Pixel Crushers Dialogue System conversation and that will flip an "inParty" variable to true. Once true, the behavior should change to Companion.

    I found this old 2008 code snippet, but it doesn't work...

    Code (CSharp):
    1.  
    2. GetComponent<Emerald_AI>().SetFollowerCompanion(GameObject.Find("Player").transform);
    3.  
    How do I do this in 2.4?
    Mark

    EDIT: Also tried:
    Code (CSharp):
    1. [/COLOR][/FONT][/LEFT]
    2.                 if (!jonahInParty)
    3.                 {
    4.                     EAIsys.CurrentFollowTarget = null;
    5.                     EAIsys.Wander();
    6.                 }
    7.                 else
    8.                 {
    9.                     //EAIsys.FollowCompanionTarget();
    10.                     EAIsys.FollowCompanionTarget();
    11.                     JoinedParty = true;
    12.                 }
    13.  
     
  17. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    578
    I made a limb based damage system for EA, just attach this to all the body parts, make sure the limb is setup like a ragdoll and has a collider and rigidbody.

    Code (CSharp):
    1. using UnityEngine;
    2. using EmeraldAI;
    3.  
    4.  
    5. [RequireComponent(typeof(Collider))]
    6. public class EA_LimbDamage : MonoBehaviour
    7. {
    8.     public EmeraldAISystem AI;
    9.  
    10.     public BODYPART BODY_PART = BODYPART.BODY;
    11.     public enum BODYPART
    12.     {
    13.         HEAD,
    14.         BODY,
    15.         ARM,
    16.         HAND,
    17.         THIGH,
    18.         LEG,
    19.         FOOT
    20.     }
    21.     public float DAMAGE_MULTI = 1f;
    22.     public bool AUTO_SETUP_MULTI = true;
    23.  
    24.  
    25.     void Awake()
    26.     {
    27.         if (AI == null)
    28.         {
    29.             AI = transform.root.GetComponent<EmeraldAISystem>();
    30.             if (!AI)
    31.             {
    32.                 Debug.LogError("CANNOT FIND EMERALD AI. ");
    33.             }
    34.         }
    35.     }
    36.  
    37.     void Start()
    38.     {
    39. if(AUTO_SETUP_MULTI)
    40.         SetupMulti();
    41.     }
    42.  
    43.     public void SetupMulti()
    44.     {
    45.         switch (BODY_PART)
    46.         {
    47.             case BODYPART.HEAD:
    48.                 {
    49.                     DAMAGE_MULTI = 2.0f;
    50.                 }
    51.                 break;
    52.             case BODYPART.BODY:
    53.                 {
    54.                     DAMAGE_MULTI = 1.0f;
    55.                 }
    56.                 break;
    57.             case BODYPART.ARM:
    58.                 {
    59.                     DAMAGE_MULTI = 0.5f;
    60.                 }
    61.                 break;
    62.             case BODYPART.HAND:
    63.                 {
    64.                     DAMAGE_MULTI = 0.1f;
    65.                 }
    66.                 break;
    67.             case BODYPART.THIGH:
    68.                 {
    69.                     DAMAGE_MULTI = 0.8f;
    70.                 }
    71.                 break;
    72.             case BODYPART.LEG:
    73.                 {
    74.                     DAMAGE_MULTI = 0.5f;
    75.                 }
    76.                 break;
    77.             case BODYPART.FOOT:
    78.                 {
    79.                     DAMAGE_MULTI = 0.1f;
    80.                 }
    81.                 break;
    82.         }
    83.     }
    84.  
    85.     public void Damage(float amount)
    86.     {
    87.         if (AI != null)
    88.         {
    89.             AI.Damage((int)(amount * DAMAGE_MULTI), EmeraldAISystem.TargetType.Player);
    90.         }
    91.     }
    92. }
    Then in your code to attack, add
    Code (CSharp):
    1. EA_LimbDamage.Damage(YOUR DAMAGE AMOUNT);
    You can either manually set each limbs damage multiplier, or it can set auto on start based on which limb it is. You can change the code to set your own damage multipliers.
     
    Last edited: Mar 30, 2020
    moqam, BHS, Penhoat and 2 others like this.
  18. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    578
    Hi, I have found what causes this, if you have a ai with both selected and are using run attacks it will cause an error saying it cant find the animation..

    EmeraldAISystem
    Code (CSharp):
    1. CurrentAnimationClip = AIAnimator.GetCurrentAnimatorClipInfo(0)[0].clip;
    i changed the error code to this
    Code (CSharp):
    1. if (AIAnimator.GetCurrentAnimatorClipInfo(0).Length > 0)
    2.                 {
    3.                     CurrentAnimationClip = AIAnimator.GetCurrentAnimatorClipInfo(0)[0].clip;
    4.                 }
    What happens is it shows the error code and the ai just goes into T pose, and sometimes it sounds like the ai is running or walking but it doesn't move.

    If I remove the run attacks it works ok, but every now and again i will receive damage from far away, and the ai is just attacking nothing in one place.


    plus the animation event errors are still showing, i've just commented the code out for now,



    Cheers Jim

    https://gyazo.com/3a06d685da5530136dda40e26a2632f0


    https://gyazo.com/cacfe053ad3561a270d19af636270dd5
     
    Last edited: Apr 1, 2020
  19. Alexandus

    Alexandus

    Joined:
    Sep 5, 2012
    Posts:
    25
    hmm, there seems to be a regression with ranged attacks, they aren't working anymore
     
  20. Penhoat

    Penhoat

    Joined:
    Mar 2, 2020
    Posts:
    99
    Hello everyone. I was using Invector's AI before, but unfortunately it wasn't working all that well with VR.
    So I'm trying Emerald AI now, and wow it's a lot more complex. it's also a lot deeper, which I do appreciate, but getting the basics done takes a lot more time.

    I'm running into the issue where the character AI is not really walking on the ground itself, but hovering slightly above it, any tips on this? I turned on the follow terrain, and while this does follow bumps, it still hoevers above.
     
    Last edited: Apr 2, 2020
  21. Alexandus

    Alexandus

    Joined:
    Sep 5, 2012
    Posts:
    25
    Likely your AI's collider needs to be lowered or decreased in height
     
    Penhoat likes this.
  22. Penhoat

    Penhoat

    Joined:
    Mar 2, 2020
    Posts:
    99
    Thanks @Alexandus, sdjusting the navmesh offset worked. Cheers

    Having the same issue. The AI doesn't seem to attack me at all. Takes the stance, but then does nothing.

    Also having issues with Detection. AI only detects the player half of the time.
    Trigger works fine, but field of view doesn't.


    Also, does Emerald support a cover type system for enemy AI? So spots where they hide behind?

    Edit: Detection issues seems to be related to having an active collider on the controller. I was using a VR controller, which don't have those (fortunately it can be set to be a trigger, so it doesn't mess up controls), adding one seems to solve the detection issues with line of sight. Interesting that it worked fine with trigger, and that the AI can detact the player just find while in combat.
     
    Last edited: Apr 3, 2020
    DJ_Design likes this.
  23. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    To anyone interested, in addition to my Playmaker actions for Emerald AI, I am now developing a full set of AI extensions for Emerald AI with integrations with various other assets. This new project will include the Playmaker actions as an optional add on. The project is called LifeLink. I don't want to pollute forums with more information, so if anyone wants to see the basic idea behind the project and discuss it, please go to my new Discord channel:

    https://discord.gg/tGA5N9M
     
    Last edited: Apr 5, 2020
  24. Perzival18

    Perzival18

    Joined:
    Feb 20, 2020
    Posts:
    4
    NullReferenceException: Object reference not set to an instance of an object
    EmeraldAI.Utility.EmeraldAIProjectile.Awake () (at Assets/Emerald AI/Scripts/Components/EmeraldAIProjectile.cs:158)
    UnityEngine.GameObject:AddComponent()
    EmeraldAI.EmeraldAISystem:CreateEmeraldProjectile() (at Assets/Emerald AI/Scripts/System/EmeraldAISystem.cs:1776)


    anyone please help
     
    unity_qdktnygEzYPZmg likes this.
  25. ArthurHoeke

    ArthurHoeke

    Joined:
    Nov 27, 2014
    Posts:
    12
    How would you go about setting up a flying enemy? There don't seem to be any settings for this to use on creatures such as dragons.
     
  26. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,270
    Use the Y offset
     
  27. Perzival18

    Perzival18

    Joined:
    Feb 20, 2020
    Posts:
    4
    Use the NavMesh, and player offset
     
  28. Alexandus

    Alexandus

    Joined:
    Sep 5, 2012
    Posts:
    25
    I've seen this as well, probably the source of the problem with ranged abilities in this update
     
    Penhoat likes this.
  29. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,270
    @BHS Please see above
     
    Alexandus and Penhoat like this.
  30. Perzival18

    Perzival18

    Joined:
    Feb 20, 2020
    Posts:
    4
    Emerald Ai and Invector integration. followed all the instructions but the AI will only damage the player when the player attacks them. but if they start the combat and the player does not attack them, it will not cause damage. any solution for this guys?
     
  31. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,270
    @BHS I am getting this error when the melee attack happens and the AI stops attacking. I am using the RFPS integration and it works fine. It just dies out when the AI gets to close when doing the animations.

    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object EmeraldAI.Utility.EmeraldAIDetection.DetectTargetType (UnityEngine.Transform Target, System.Nullable`1[T] OverrideFactionRequirement) (at Assets/Systems/Emerald AI/Scripts/Components/EmeraldAIDetection.cs:1025) EmeraldAI.Utility.EmeraldAIDetection.SetDetectedTarget (UnityEngine.Transform DetectedTarget) (at Assets/Systems/Emerald AI/Scripts/Components/EmeraldAIDetection.cs:1000) EmeraldAI.Utility.EmeraldAIDetection.SearchForTarget () (at Assets/Systems/Emerald AI/Scripts/Components/EmeraldAIDetection.cs:959) EmeraldAI.Utility.EmeraldAIDetection.DetectTarget (UnityEngine.GameObject C) (at Assets/Systems/Emerald AI/Scripts/Components/EmeraldAIDetection.cs:343) EmeraldAI.Utility.EmeraldAIDetection.UpdateAIDetection () (at Assets/Systems/Emerald AI/Scripts/Components/EmeraldAIDetection.cs:602) EmeraldAI.Utility.EmeraldAIDetection.Update () (at Assets/Systems/Emerald AI/Scripts/Components/EmeraldAIDetection.cs:59)(edited)
    Code (CSharp):
    1.  
    2. NullReferenceException: Object reference not set to an instance of an object EmeraldAI.Utility.EmeraldAIDetection.DetectTargetType (UnityEngine.Transform Target, System.Nullable1[T] OverrideFactionRequirement) (at Assets/Systems/Emerald AI/Scripts/Components/EmeraldAIDetection.cs:1025) EmeraldAI.Utility.EmeraldAIDetection.SetDetectedTarget (UnityEngine.Transform DetectedTarget) (at Assets/Systems/Emerald AI/Scripts/Components/EmeraldAIDetection.cs:1000) EmeraldAI.Utility.EmeraldAIDetection.SearchForTarget () (at Assets/Systems/Emerald AI/Scripts/Components/EmeraldAIDetection.cs:959) EmeraldAI.EmeraldAISystem.Damage (System.Int32 DamageAmount, System.Nullable1[T] TypeOfTarget, UnityEngine.Transform AttackerTransform, System.Int32 RagdollForce, System.Boolean CriticalHit) (at Assets/Systems/Emerald AI/Scripts/System/EmeraldAISystem.cs:2198) WeaponBehavior.HitObject (UnityEngine.RaycastHit hit, UnityEngine.Vector3 directionArg, System.Boolean isSecondCast) (at Assets/Systems/RFPSP/Scripts/Weapons/WeaponBehavior.cs:2164) WeaponBehavior+<FireOneShot>d__353.MoveNext () (at Assets/Systems/RFPSP/Scripts/Weapons/WeaponBehavior.cs:2090) UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <d815b7efac424eeb8e053965cccb1f98>:0)
     
    Last edited: Apr 7, 2020
  32. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
     
  33. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Unfortunately, I didn't get the chance to add this in with 2.4.0. If you want, PM me the updated code so I can see specifically what was done so I can try and squeeze it in with the next update. As for the camera fix, thanks. I'll add this in with the next update.
     
  34. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Take a look at the Emerald AI API here: https://github.com/Black-Horizon-Studios/Emerald-AI/wiki/Emerald-AI-API. It has tons of code snippets and examples to do what you want.

    You can set a follower using this: https://github.com/Black-Horizon-Studios/Emerald-AI/wiki/Emerald-AI-API#SetFollowerTarget

    It's as easy as the code below. See the links above for an example on how to access the EventsManager script.
    Code (CSharp):
    1. EventsManager.SetFollowerTarget(Transform Target)
     
  35. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Thanks for the bug report, I will look into this. What's strange is that I tested the run attacks quite a bit with various characters and didn't receive this error, but I will try to recreate this. How many run attack animations does your AI have?

    While adding if (AIAnimator.GetCurrentAnimatorClipInfo(0).Length > 0) works, it adds quite a bit of garbage, according to the Unity Profiler, and only prevents the error from being displayed when an animation is missing. I'll look into a solution for this though.
     
  36. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Can you please provide more information regarding this?
     
  37. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Do you have any other components on your projectile? You shouldn't have any colliders or rigidbodies as Emerald AI adds these at runtime. Can please you provide steps to recreate this, if possible?
     
  38. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    In order for AI to attack a player when they enter their detection radius, they need to have an Enemy Player Relation: https://github.com/Black-Horizon-St...-Faction-Manager#setting-up-faction-relations
     
  39. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    My guess is that Emerald AI is detecting the wrong collider object of the RFPS system. Double check that it's grabbing the right object by enabling all of the Debug Tools (Located at the bottom of the Docs tab). This is debug log the detected target to the Unity Console.
     
  40. Penhoat

    Penhoat

    Joined:
    Mar 2, 2020
    Posts:
    99
    I have the same issue. There are no errors, the AI simply stands there in their combat animations, but the attack animation doesnt start, nor do they shoot.
     
  41. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,270
    @Penhoat watch my video. Does it look like that? My AI's attack but then stop... @BHS i turned on debugging and nothing? I bet the same would happen with your RFPS instance. If not, I can send ya my project... Its broken not matter how I shake it.
     
  42. Penhoat

    Penhoat

    Joined:
    Mar 2, 2020
    Posts:
    99
    Nah that's a different issue. Mine is like @Alexandus where the ranged attack simply doesnt start.
     
  43. Alexandus

    Alexandus

    Joined:
    Sep 5, 2012
    Posts:
    25
    +1 they move around but don't initiate ranged abilities. Melee still works
     
  44. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    578
    Hey, Thanks for your response :) I have had the errors using multiple ai and each have between 1 and 3 run attack animations. I can send you a prefab of one of them to get the settings if you like. Not sure if it has to do with ranges.

    Anyway thank you for awesome ai system :)
     
  45. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,270
    @BHS Found out what my issue was! What do you have slated for next update?
     
  46. Mad_Mark

    Mad_Mark

    Joined:
    Oct 30, 2014
    Posts:
    484
    It seems if the AI is set for both Melee & Ranged, it is being set back to Melee only during runtime. At least in my project. It didn't always do this, and my code is modified, but that is what I am seeing. Hope it helps...

    Mark
     
  47. LuciaSystem

    LuciaSystem

    Joined:
    May 21, 2017
    Posts:
    7
    the Casting Effect Direction of the Ranged AI is Sometimes Right and Sometimes Wrong ?! How can I Fix it ?!
     

    Attached Files:

  48. Alexandus

    Alexandus

    Joined:
    Sep 5, 2012
    Posts:
    25
    My AI's that encountered this bug are set to ranged only
     
    Penhoat likes this.
  49. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,270
    I have the Jurassic Pack 1 and first, the animations for the TRex and Spinosaurus look odd when walking. Next both seem that they can't attack my RFPS character. They just continuously walk on top of my character. The Raptors dont seem to have any issues. Any ideas?
     
  50. combatsheep

    combatsheep

    Joined:
    Jan 30, 2015
    Posts:
    133
    Hi,
    Do I need clean import from ver2.3.x to ver2.4.x?
    Or, Is it enough to update with overwrite importing?

    Thanks.