Hello Guest

Author Topic: UIItem in Scrollable Area does not fire Clicks  (Read 4485 times)

Arnold

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 32
  • Create something you love!
    • View Profile
UIItem in Scrollable Area does not fire Clicks
« on: December 22, 2013, 03:35:26 pm »
Hey,

I have a Prefab with which is a UIItem (target is another gameobj, which should fire a method with "on release" ) which resides inside a Scrollable Area. If i drag & drop the Prefab in the scene view manually and try to click it, everything works as it should. When i instantiate the same prefab via load from the resources it does not get recognized. I have checked if the Prefab Clone has different values than the one i drag & droped, but they are the same.

I'm completely lost on this on.

*Update:

Problem seems to be another one i attached a screenshot. If the Sprite is below the Scroll area it don't get any clicks, if it's not below it works...
« Last Edit: December 22, 2013, 04:40:08 pm by Arnold »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Per script loaded UIItem in Scrollable Area does not fire Clicks
« Reply #1 on: December 22, 2013, 04:34:06 pm »
If its a prefab then it won't remember in scene targets. How are you setting up the targets, and #2 where are the transform positions when instantiating? It could be behind a collider which is stopping it from receiving clicks. It also might not have the isChildOfAnotherUIItem ticked? If you change the parent, you should also call UpdateParent after reparenting.

Arnold

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 32
  • Create something you love!
    • View Profile
Re: UIItem in Scrollable Area does not fire Clicks
« Reply #2 on: December 22, 2013, 04:44:32 pm »
Its definitely the scroll area collider who is stopping it, but how should i set it up. This is exactly like in the UI Demo, but i'm using a sprite instead of a UI Button.

*Update:

Ok wow i fixed it. My Sprite was on the wrong z. The scrollable area is on 0 my sprite on 1. That was wrong, after changing it to 0 it worked. An Afternoon wasted!

Thanks for hint ;).
« Last Edit: December 22, 2013, 05:00:59 pm by Arnold »