Enemy AI Movement To A Target(Player) In A 2D Game

Hello everybody, this is my C# Script:

using UnityEngine;
using System.Collections;

public class EnemyAI : MonoBehaviour {

	public Transform Target;
	private GameObject Enemy;
	private GameObject Player;
	private float Range;
	public float Speed;


	// Use this for initialization
	void Start () {
		Enemy = GameObject.FindGameObjectWithTag ("Enemy");
		Player = GameObject.FindGameObjectWithTag ("Player");
	}
	
	// Update is called once per frame
	void Update () {
		Range = Vector2.Distance (Enemy.transform.position, Player.transform.position);
		if (Range <= 15f) {
			transform.Translate(Vector2.MoveTowards (Enemy.transform.position, Player.transform.position, Range) * Speed * Time.deltaTime);
				}
	}
}

Now, this script work for 3 seconds (in this time i move to two different directions whit the player) , but when i try to move in a third different direction the Enemy still goes in the previous direction! Is that a script problem? Help me please!
[I’m italian, so dont speak strong english… use easy words :slight_smile: ]

Wy dont you make the enemy look at the player and then call: transform.position += transform.forward * speed * Time.deltaTime

Can somebody translate this to Javascript? I’m not very good with C# and I’d like to understand this script better. I don’t like copying and pasting scripts without knowing how to make adjustments to them. Thanks in advance!

use this

Vector2 velocity = new Vector2((transform.position.x - player.position.x) * speed, (transform.position.y - player.position.y) * speed);
		rigidbody2D.velocity = -velocity;