I have a mechanic in my new project where Enemies are programmed to chase the player but only if they have their "torch" enabled. As you will see in the script, I do this with a null check

Here is the code:

```
public class chasePlayer : MonoBehaviour
{
    public Transform target;
    public float speed;
    public Light playerLight;

    void followLight()
    {
        if (playerLight != null)
        {
            speed = 1;
            float walkspeed = speed * Time.deltaTime;
            transform.position = Vector3.MoveTowards(transform.position, target.position, walkspeed);
        }
    }

    void stopFollowing()
    {
        if (playerLight = null)
        {
            speed = 0;
        }
    }

    void Update()
    {
        followLight();
        stopFollowing();
    }
}

```

The problem is, I think I have all the code right and in theory it should do what I want it to, but it doesnt. It doesn't move at all even when I start the game where it should.

What could I possibly be doing wrong.
First time doing an original script so probably lots going wrong