Author Topic: unity 4.5 with ngui 3.7.1 using BoxCollider 2D  (Read 5764 times)

Leo_Hsu

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
unity 4.5 with ngui 3.7.1 using BoxCollider 2D
« on: September 14, 2014, 04:22:02 AM »
Hello, I got some problem with this case by using BoxCollider2D.
When NGUI upgrade to version 3, the default scale of widget change to 1 and use the dimension to control the size . But if the widget size is less then 25*25 , the boxcollider2D was too smal to create a collision shape, I saw some one also got same problem on the forum .Does this issue fixed in the lates version of NGUI ? I tried to increase the scale of UIRoot Obj by disabling UIRoot script and size of Camera , it will make the collider2d got enough size to create collision.  But it seems not a good solution , Does NGUI provide any function to re-scale UIRoot and resize camera?

Thanks,
Leo.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: unity 4.5 with ngui 3.7.1 using BoxCollider 2D
« Reply #1 on: September 14, 2014, 04:39:25 AM »
Simple solution -- don't use Box2D colliders. Use regular 3D ones, same as before. There is no reason to switch to 2D.

Leo_Hsu

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
Re: unity 4.5 with ngui 3.7.1 using BoxCollider 2D
« Reply #2 on: September 14, 2014, 09:36:03 AM »
I need to use polygon collider2d for some specific case in my game play. thanks for the infomation. I will try something else to resolve this issue.

SmartCarrion

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
Re: unity 4.5 with ngui 3.7.1 using BoxCollider 2D
« Reply #3 on: July 04, 2015, 03:09:29 AM »
Is this seriously the solution?  "Don't use Box Collider 2D" ?

why do you even support 2D at all then?  Also, why does NGUI have to scale the UI down to micro size?  this wouldn't be a problem if it wasn't 1000x smaller than the rest of the game world.

UI Camera does not allow mixing of events from 2D and 3D colliders, so i would have to redo everything into 3D colliders to fix this bug on my end?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: unity 4.5 with ngui 3.7.1 using BoxCollider 2D
« Reply #4 on: July 06, 2015, 08:02:04 PM »
NGUI doesn't "have" to do anything. It's up to you to use UIRoot or not. You can remove it, or just change its manual height to 1.