I’ve got an imported blender3d triangle model (see below). I’ve checked ‘generate colliders’ on the import settings and attached it to a prefab that is identical to an old cylinder unity mesh prefab I was using as a dev graphic.
I’ve set up code to fire once you click on it (via raycast hit, see below), but when I use the mesh, it’s not hitting. I noted that when I select ‘convex’, green outlines appear on the triangular pyramid’s sides, but it does not register clicks still.
I have tested with the generic unity cylinder and the base code is still functional. Snippets and screens below.
Click method:
RaycastHit hit = new RaycastHit();
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
if (Physics.Raycast(ray, out hit))
{
if (hit.collider.gameObject.tag == "Triangle")
{
OpenMenu();
}
}
}
Triangle (Mesh) inspector
Cylinder (Unity) inspector