I have been running into an issue with a simple script attached to a cylinder that I used to do something when it is clicked on : some areas of the cylinder do not trigger the script.
I have recreated a quick test project to reproduce the issue.
A camera with a Physics raycast attached, child Canvas, another child is the Cylinder to which is attached a simple script.
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using UnityEngine.EventSystems;
public class UIClick : MonoBehaviour, IPointerClickHandler {
void IPointerClickHandler.OnPointerClick(PointerEventData eventData)
{
Debug.Log(“Cylinder clicked”);
}
}
The scene is set so that I am watching the cylinder from top (it is just a basic cylinder with a Diffuse shader attached to it).
X are some points that react to click, triangles are unresponsive points. By the way in each configuration my mouse pointer was entirely contained in the cylinder so that is not the issue.
In general, the area near the edge do not respond to click, though it does not seem homogenous in radius.
Any idea why this is happening ?