the player doesn’t follow mouse after collide, enemy, follow the player and when he colid whit him and do damage
the movement stop work wall and the player stop follow the mouse
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class playermovment : MonoBehaviour
{
[SerializeField]
float MoveSpeed = 0.34f;
Vector2 MouseInWorld;
void Start()
{
}
// Update is called once per frame
void Update()
{
MouseInWorld = Camera.main.ScreenToWorldPoint(Input.mousePosition);
transform.position = Vector3.Lerp(transform.position, MouseInWorld, MoveSpeed);
}
}