Hi i could we use the raycast to check if we hit a specific layer something like this
private void InteractWithCombat()
{
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
RaycastHit hit;
bool hasHit = Physics.Raycast(ray, out hit, LayerMask.GetMask("Enemy"));
if (hasHit)
{
GetComponent<Fighter>().Fight();
}
}
or would it cause some problerms later in the course?