How to create a follow bot. Please help!

I am trying to create a follow bot type character that will follow the player when the player enters a collider.
This is what I have so far…

using UnityEngine;
using System.Collections;

public class FollowBot : MonoBehaviour {
	
	Transform Player;
	public float AISpeed = 10;
	public float MinDistance = 2;

	// Use this for initialization
	void Start () {
		Player = GameObject.FindGameObjectWithTag ("Player").transform;
	}
		
	void OnTriggerEnter(Collider obj) {
		if(gameObject.tag ==("Player")){
			if (Vector3.Distance(transform.position, Player.position) >= MinDistance){
			transform.position += transform.forward*AISpeed*Time.deltaTime;
			}
		}
	}
}

It doesn’t seem to work at all at the moment but I’m not sure why. It was working previously but when I modified it to make the follow bot follow the player when they enter the collider it stopped working. I can’t remember what I changed now because I tried multiple things.
If someone could please help me out that would be greatly appreciated. Thank you.

When the player enters the trigger, you are checking that the object that the script is attatched to has the tag Player, not the object entering the trigger. Instead of gameObject.tag, try using obj.tag.

Here is a simple example:

using UnityEngine;

[RequireComponent(typeof(SphereCollider))]
public class FollowBot : MonoBehaviour {
	public bool followingPlayer { get; private set; }

	[SerializeField] private float _moveSpeed = 2f;
	[SerializeField] private float _minDistance = 2f;
	[SerializeField] private float _triggerRadius = 6f;
	[SerializeField] private Transform _player;
	private Transform _transform;

	private void Awake() {
		_transform = transform;

		//Init player transform
		if (_player == null) {
			_player = GameObject.FindGameObjectWithTag("Player").transform;
			#if UNITY_EDITOR
			if (_player == null)
				Debug.LogWarning(gameObject.name + "Could not find a Gameobject with the tag \"Player\"");
			#endif
		}

		//Init collider
		var collider = GetComponent<SphereCollider>();
		collider.radius = _triggerRadius;
		collider.isTrigger = true;

		//Init rigidbody
		var rigidbody = GetComponent<Rigidbody>();
		if (rigidbody == null) {
			rigidbody = gameObject.AddComponent<Rigidbody>();
			rigidbody.isKinematic = true;
			rigidbody.useGravity = false;
		}
	}

	private void Update() {
		if (followingPlayer && Vector3.Distance(_transform.position, _player.position) > _minDistance) {
			Vector3 direction = _player.position - _transform.position;
			_transform.position += direction.normalized * _moveSpeed * Time.deltaTime;

			_transform.LookAt(_player);
		}
	}

	private void OnTriggerEnter(Collider c) {
		if (c.transform == _player)
			followingPlayer = true;
	}

	private void OnTriggerExit(Collider c) {
		if (c.transform == _player)
			followingPlayer = false;
	}
}

void OnTriggerEnter(Collider obj) {
if(gameObject.tag ==(“Player”)){
if (Vector3.Distance(transform.position, Player.position) >= MinDistance){
transform.position += transform.forwardAISpeedTime.deltaTime;
}
}
}

Here you are checking if gameObject.tag==“Player”, you want if(obj.gameObject.tag

And I think obj.gameObject.CompareTag(“Player”) is meant to be mroe efficient?