0

I am trying to create a Fan Menu in Unity. Currently, I have a crude fan chart that I was wanting to implement a few basic scripts, such as enlarge on hover and call a function on click. I tried to use OnPointerEnter, but it was triggering on the shape of the square image. I would like the menu option (which isn't rectangular) to only enlarge if it is hovered on, not empty space to the side of it.

public void OnPointerEnter(PointerEventData eventData)
    {
        Debug.Log("Mouse enter");
        rt = gameObject.GetComponent<RectTransform>()
        rt.sizeDelta = startSize * enlargeFactor;
    }

This Does trigger, but not on the shape of my fan menu item, but in the square of the image itself. I tried to implement OnMouse events with a collider, instead of OnPointer Events, but nothing was triggering and from here I read that they are no longer implemented for UI's in Unity. Does anyone have any ideas as to a good approach to this problem, and a solutionExample of a single crude pie chart menu item Example of a single crude pie chart menu item

0 Answers0