I dont know why but i have a problem in showing a tooltip properly.
As you can see, the tooltip is showing at the back of the slots when i point my mouse in the Item.
I want to make that when i put the mouse in the item, The tooltip will appear in front.
Please help me im new in c#
This is the code function for the position of the tooltip
public void ShowToolTip(GameObject slot)
{
Slot tmpSlot = slot.GetComponent<Slot>();
//if the slot is not empty
if (!tmpSlot.IsEmpty)
{
tooltip.SetActive(true);
float xPos = slot.transform.position.x + slotPaddingLeft;
float yPos = slot.transform.position.y - slot.GetComponent<RectTransform>().sizeDelta.y - slotPaddingTop;
tooltip.transform.position = new Vector2(xPos,yPos);
}