When I add the parameters (CombatTarget combatTarget) to Attack() I am given an error in Unity saying no argument given that corresponds to the required formal parameter.
I can confirm the Combat Target script is attached to my enemy. My Combat Target script looks like this:
using UnityEngine;
namespace RPG.Combat
{
public class CombatTarget : MonoBehaviour
{
}
}
My fighter script looks like this:
using UnityEngine;
using RPG.Movement;
namespace RPG.Combat
{
public class Fighter : MonoBehaviour
{
Transform target;
void Update()
{
if (target != null)
{
GetComponent<Mover>().MoveTo(target.position);
}
}
public void Attack(CombatTarget combatTarget)
{
target = combatTarget.transform;
print ("Take that, corporate scum!");
}
}
}
Have I missed something?