Author Topic: OnClick seems offset from colliders  (Read 4393 times)

sburgoon

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 19
    • View Profile
OnClick seems offset from colliders
« on: August 15, 2012, 06:01:18 PM »
I have a pretty simple setup. I have a panel that is below an anchor, and in that panel I'm creating a bunch of labels at runtime, and assigning colliders to them, along with my own custom script with an OnClick event. The events are getting triggered, but I have to click about a hundred pixels above where the colliders are located. When I pause the scene and look, the colliders are exactly on the labels (they are attached to the same game object too), but when I run the game and click, it only responds when I click above them. My ui uses its own layer, so there is no layer overlap with the main game-camera. Any ideas?

-Sean

sburgoon

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 19
    • View Profile
Re: OnClick seems offset from colliders
« Reply #1 on: August 15, 2012, 06:23:06 PM »
And I'm an idiot. My custom cursor was offset from the real one. A lesser man would remove his post entirely, but I will face the public shaming so that possibly some other poor soul might see this, and check his cursor offset before making a fool of himself ;) Problem solved.

ENAY

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 248
    • View Profile
Re: OnClick seems offset from colliders
« Reply #2 on: August 16, 2012, 01:56:34 AM »
Join the club, I often solve my problems straight away after posting here :)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: OnClick seems offset from colliders
« Reply #3 on: August 16, 2012, 10:04:55 AM »
Works for me like that too!