I have followed the code exact & keep getting this error on emerald AI can someone please help before I have to reflect this issue on my review of emerald because I bought it to integrate on invector
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using EmeraldAI.Example;
namespace EmeraldAI
{
//This script will automatically be added to player targets. You can customize the DamagePlayerStandard function
//or create your own. Ensure that it will called within the SendPlayerDamage function. This allows users to customize
//how player damage is received and applied without having to modify any main system scripts. The EmeraldComponent can
//be used for added functionality such as only allowing blocking if the received AI is using the Melee Weapon Type.
public class EmeraldAIPlayerDamage : MonoBehaviour
{
public void SendPlayerDamage(int DamageAmount, Transform Target, EmeraldAISystem EmeraldComponent)
{
//The standard damage function that sends damage to the Emerald AI demo player
DamagePlayerStandard(DamageAmount);
//Sends damage to another function that will then send the damage to the RFPS player.
//If you are using RFPS, you can uncomment this to allow Emerald Agents to damage your RFPS player.
//DamageRFPS(DamageAmount, Target);
//DamageInvectorPlayer(DamageAmount, Target);
}
void DamagePlayerStandard(int DamageAmount)
{
if (GetComponent<EmeraldAIPlayerHealth>() != null)
{
GetComponent<EmeraldAIPlayerHealth>().DamagePlayer(DamageAmount);
}
}
/*
void DamageRFPS(int DamageAmount, Transform Target)
{
if (GetComponent<FPSPlayer>() != null)
{
GetComponent<FPSPlayer>().ApplyDamage((float)DamageAmount, Target, true);
}
}
*/
void DamageInvectorPlayer(int DamageAmount, Transform Target)
{
if (GetComponent<Invector.vCharacterController.vCharacter>())
{
//Applies damage to Invector and allows its melee weapons to block incoming Emerald AI damage.
if (GetComponent<Invector.vCharacterController.vMeleeCombatInput>().meleeManager != null)
{
var PlayerInput = GetComponent<Invector.vCharacterController.vMeleeCombatInput>();
var MeleeManager = GetComponent<Invector.vCharacterController.vMeleeCombatInput>().meleeManager;
if (PlayerInput.isBlocking)
{
var _Damage = new Invector.vDamage(DamageAmount);
var DamageReduction = MeleeManager != null ? MeleeManager.GetDefenseRate() : 0;
if (DamageReduction > 0)
_Damage.ReduceDamage(DamageReduction);
MeleeManager.OnDefense();
_Damage.reaction_id = MeleeManager.GetDefenseRecoilID();
_Damage.sender = Target;
_Damage.hitPosition = Target.position;
GetComponent<Invector.vCharacterController.vCharacter>().TakeDamage(_Damage);
}
else
{
var _Damage = new Invector.vDamage(DamageAmount);
_Damage.sender = Target;
_Damage.hitPosition = Target.position;
GetComponent<Invector.vCharacterController.vCharacter>().TakeDamage(_Damage);
}
}
//If no Melee Manager is found, cause unreduced damage.
else
{
var _Damage = new Invector.vDamage(DamageAmount);
_Damage.sender = Target;
_Damage.hitPosition = Target.position;
GetComponent<Invector.vCharacterController.vCharacter>().TakeDamage(_Damage);
}
}
}
}