Hi for some reason when putting my mouse near enemies the attack icon is shown and works even when the mouse is very far away from the enemy.
I’ve tried taking a screenshot but unfortunately, my mouse is never included in the screenshot.
It works fine for the pickups but with enemies, it doesn’t work correctly.
Here is my code:
RaycastHit[] RaycastAllSorted()
{
RaycastHit[] hits = Physics.SphereCastAll(GetMouseRay(), _interactRaycastRadius);
float[] distances = new float[hits.Length];
for (int i = 0; i < hits.Length; i++)
{
distances[i] = hits[i].distance;
}
Array.Sort(distances, hits);
return hits;
}
I’ve even tried setting the _interactRaycastRadius to as low as 0.05f and it doesn’t affect the clickable area when it comes to enemies in the slightest, but it does for the pickups.