Hello I am now facing this issue and I have no idea what’s going on…
The console output is print(GetComponent().rect) of the panel…
Any ideas on how to fix this? I want to use GetComponent().rect.Contains(mousepos) for my Inventory system…
Hello I am now facing this issue and I have no idea what’s going on…
The console output is print(GetComponent().rect) of the panel…
Any ideas on how to fix this? I want to use GetComponent().rect.Contains(mousepos) for my Inventory system…
Try this: Unity - Scripting API: RectTransformUtility.RectangleContainsScreenPoint
pass ‘null’ as the camera if you’re using screen space overlay.
I wanted to add that if this is for selecting or dropping inventory items into “slots”, I would suggest that you use the IDragHandler, IDropHandler, and other pointer interfaces to help you.
Damn, you’re the man! Thank you very much, this is the answer I needed!
You’re welcome.