I don’t get it. I want it to check if it finds a collider with the tag Lootable. What am I missing here? I’m so confused :\
private void FixedUpdate()
{
mouseRay = Camera.main.ScreenPointToRay(Input.mousePosition);
RaycastHit rayHit;
if (Input.GetButtonDown("Fire1"))
{
Physics.Raycast(mouseRay, out rayHit);
if (rayHit.collider.tag.Equals("Lootable"))
{
print("hit");
print(inventoryWindowShow);
inventoryWindowShow = true;
}
}
if (Input.GetKeyDown(KeyCode.Escape))
{
inventoryWindowShow = false;
}
}