I am currently working on a AI script and its no where near complete but i got this error and i dont understand what its trying to get me to do
using UnityEngine;
using System.Collections;
public class NPC_AI : MonoBehaviour {
public float Speed = 6.0f;
public float rotateSpeed = 6.0f;
public int Range = 20;
public int minHealth = 1;
public int curHealth = 100;
public int maxHealth = 100;
public int GiveXP;
public Transform Player;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
if(curHealth < minHealth) {
System.Object PlayerController = GetComponent<PlayerController>();
PlayerController.XP += GiveXP();
}
}
}
I have a public int XP in my PlayerController script also and i just dont understand how im getting this error
The error is:
Assets/My Assets/Scripts/NPC/NPC_AI.cs(28,48): error CS1955: The member `NPC_AI.GiveXP' cannot be used as method or delegate
Any help is apppreciated