Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Voting for the Unity Awards are OPEN! We’re looking to celebrate creators across games, industry, film, and many more categories. Cast your vote now for all categories
    Dismiss Notice
  3. Dismiss Notice

[SOLVED]Unity UI panel - RectTransform.rect

Discussion in 'UGUI & TextMesh Pro' started by vojtiman, Feb 6, 2018.

  1. vojtiman

    vojtiman

    Joined:
    Jul 9, 2014
    Posts:
    3
    Hello I am now facing this issue and I have no idea what's going on...
    The console output is print(GetComponent<RectTransform>().rect) of the panel...

    Any ideas on how to fix this? I want to use GetComponent<RectTransform>().rect.Contains(mousepos) for my Inventory system.... :(
     
  2. methos5k

    methos5k

    Joined:
    Aug 3, 2015
    Posts:
    8,712
    vojtiman likes this.
  3. methos5k

    methos5k

    Joined:
    Aug 3, 2015
    Posts:
    8,712
    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. :)
     
    vojtiman likes this.
  4. vojtiman

    vojtiman

    Joined:
    Jul 9, 2014
    Posts:
    3
  5. methos5k

    methos5k

    Joined:
    Aug 3, 2015
    Posts:
    8,712
    You're welcome. :)
     
    vojtiman likes this.