private void FixedUpdate()
{
posPlayer = new Vector2(playerObject.transform.position.x, transform.position.y);
Vector2 posObj = new Vector2(transform.position.x, transform.position.y);
Vector2 newPosition = Vector2.MoveTowards(posObj, posPlayer, Time.deltaTime * speed);
if (isPlayerEntered)
rigidbody2D.MovePosition(newPosition);
}
isPlayerEntered == false
true