Author Topic: Collider autoresize  (Read 4136 times)

Alessaint

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 67
    • View Profile
Collider autoresize
« on: September 01, 2014, 11:47:26 AM »
I've come across some strange behavior. I have a prefab with UItexture with collider autoresize enabled. I instantiate this prefab during runtime and set its texture. Mouseover for this instance works just fine - but only in editor. When I build the game, suddenly the collider autoresize stops working - the collider size doesn't match the texture, mouseover action shows it's way smaller (maybe some default value). If I call uitexture.ResizeCollider() manually immediately after the instance has been created and texture set, it gets resized ok and works fine even when run from built exe.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Collider autoresize
« Reply #1 on: September 01, 2014, 02:34:27 PM »
Not sure about this one. I'm not aware of any related issues. Perhaps it has something to do with how you instantiate the object, or the script execution order?