A bit of query if the following proposed alternative approach is fine or not:
, so we can only add this “hitObj.transform.tag == “Water”” so that the water layer is not showing the walking cursor. Additioanlly, adding a maxRayDistance so the player cann’t go too far.
Thank you in advance.
private bool InteractWithMover()
{
Ray ray = GetMouseRay();
bool hasHit = Physics.Raycast(ray, out hitObj, maxRayDistance);
if (hasHit)
{
if (hitObj.transform.tag == "Water")
{
return false;
}
if (!Input.GetMouseButton(1) && Input.GetMouseButton(0))
{
GetComponent<Mover>().StartMoveAction(hitObj.point, playerNormalSpeedFraction);
}
SetCurser(CursorType.Movement);
return true;
}
return false;
}