Emerald AI Integration

nathanj

Active member
So I have most of this working, except some of my hits aren't registering. Anyone farmilliar with this error? I believe it has something to do with the angle at which I attack the AI.

Code:
UnassignedReferenceException: The variable CurrentTarget of EmeraldAISystem has not been assigned.
You probably need to assign the CurrentTarget variable of the EmeraldAISystem script in the inspector.
UnityEngine.Transform.get_position () (at <0847a0faf94444ccbaf1958021b27f54>:0)
EmeraldAI.EmeraldAISystem.TargetAngle () (at Assets/Emerald AI/Scripts/System/EmeraldAISystem.cs:2586)
EmeraldAI.EmeraldAISystem.Damage (System.Int32 DamageAmount, System.Nullable`1[T] TypeOfTarget, UnityEngine.Transform AttackerTransform, System.Int32 RagdollForce, System.Boolean CriticalHit) (at Assets/Emerald AI/Scripts/System/EmeraldAISystem.cs:2354)
Magique.OpsiveBridge.OnObjectImpact (System.Single amount, UnityEngine.Vector3 position, UnityEngine.Vector3 forceDirection, UnityEngine.GameObject attacker, System.Object attackerObject, UnityEngine.Collider hitCollider) (at Assets/Emerald AI/Scripts/Integrations/OpsiveBridge.cs:20)
Opsive.Shared.Events.InvokableAction`6[T1,T2,T3,T4,T5,T6].Invoke (T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6) (at <fa7bae0bde914e57874fdb6999909243>:0)
Opsive.Shared.Events.EventHandler.ExecuteEvent[T1,T2,T3,T4,T5,T6] (System.Object obj, System.String eventName, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6) (at <fa7bae0bde914e57874fdb6999909243>:0)
Opsive.UltimateCharacterController.Objects.Destructible.OnCollision (System.Nullable`1[T] hit) (at Assets/Opsive/UltimateCharacterController/Scripts/Objects/Destructible.cs:223)
Opsive.UltimateCharacterController.Objects.Projectile.OnCollision (System.Nullable`1[T] hit) (at Assets/Opsive/UltimateCharacterController/Scripts/Objects/Projectile.cs:64)
Opsive.UltimateCharacterController.Objects.TrajectoryObject.Move (UnityEngine.Vector3& position, UnityEngine.Quaternion rotation) (at Assets/Opsive/UltimateCharacterController/Scripts/Objects/TrajectoryObject.cs:588)
Opsive.UltimateCharacterController.Objects.TrajectoryObject.FixedUpdate () (at Assets/Opsive/UltimateCharacterController/Scripts/Objects/TrajectoryObject.cs:512)

Thanks in advance,
Nathan
 

MissBig

Member
I did have this integrated with Opsive once before but I tried it again and when AI runs to me he will just don't attack he just stops and idles does anyone know how to fix this I'm sure I am forgetting something.
 

MissBig

Member
I did have this integrated with Opsive once before but I tried it again and when AI runs to me he will just don't attack he just stops and idles does anyone know how to fix this I'm sure I am forgetting something.
Anyone had this issue before I know I have had it before but just can't work out how I fixed it.
 

MissBig

Member
Anyone had this issue before I know I have had it before but just can't work out how I fixed it.
I decided to go back to my old project instead where there was a working zombie but I noticed that if you shoot AI first it comes after you but just don't attack you but if you let the AI attack you first then it works as expected so I think there may be a problem with this integration although I had this exact same problem when I used the horror FPS kit from the asset store. The only controller I have working perfectly was the neoFPS. I was just trying to achieve a quick setup that's why I was trying Emerald AI because of its simplicity I might have to just use Behaviour designer which works great but just takes longer to achieve a good basic AI. It would be great if there was a proper integration.
 

tab

New member
Anyone had this issue before I know I have had it before but just can't work out how I fixed it.
I have the exact same problem and haven't found a fix. I followed the integration instructions and checked everything. The animal runs after the player but the attack animation never plays. When it gets close to the play it just stops and stands still. Anyone got any idea how to fix this?
 

Mattis

Member
Hi! Anyone got the AI to attack the player ? I have Collider gameobject on character set to Tag Player and Layer character, that works he run after me but wont attack... I have the AI to Enemy on layer... it wont work.. NEVER attacks.. He just stands still, if I have use block checked he blocks and go forward and blocks again and keeps doing that... If I set a cube with tag player and layer character, the AI behavs as he should.... Ideas?
 

Mattis

Member
I have the exact same problem and haven't found a fix. I followed the integration instructions and checked everything. The animal runs after the player but the attack animation never plays. When it gets close to the play it just stops and stands still. Anyone got any idea how to fix this?
Found a solution yet?
 

Mattis

Member
I have the exact same problem and haven't found a fix. I followed the integration instructions and checked everything. The animal runs after the player but the attack animation never plays. When it gets close to the play it just stops and stands still. Anyone got any idea how to fix this?
I have fixed this issue. Where the capsule collider positioner is, set capsule y center on 0.6. height of it 2. Radius 0.25-0.5
 

Mattis

Member
The problem was that AI wasn't able to attack because the script that controlls the capsule collider sat the center point too low . This is kind of a dirty fix but it works. So when someone comes with a better solution please post.
 
Top