Please Help
I’m getting an " Object reference not set to an instance of an object" error and I can’t figure out why :0
I went through the course content and still couldn’t see where I have gone wrong. our code is identical as far as I can tell
Code as follows, Getting the error on the first line of my update method.
private void Update()
{
bool isInRange = Vector3.Distance(transform.position, target.position) < weaponRange;
if (target != null && !isInRange)
{
GetComponent<Mover>().MoveTo(target.position);
}
else
{
GetComponent<Mover>().Stop();
}
}