Author Topic: Rigidbody on UIPanel still needed?  (Read 7037 times)

avatara359

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 8
    • View Profile
Rigidbody on UIPanel still needed?
« on: July 21, 2015, 08:58:55 PM »
I'm using the latest NGUI (3.9.1). I noticed that UIPanels don't automatically add a rigidbody any more. The only rigidbody appears to be on the UIRoot.

I have a lot of rigidbodies in my UI because every UIPanel used to add a rigidbody. Is it recommended to remove all the extra old rigidbodies? Leaving just the Root rigidbody?

Also should all box colliders be set to "is trigger"? That appears to be the default from creating a collider from the ngui pull down menu. Its also what I normally try to set it to.

Thanks!
« Last Edit: July 21, 2015, 09:14:27 PM by avatara359 »

pahe

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 1
  • Posts: 37
    • View Profile
Re: Rigidbody on UIPanel still needed?
« Reply #1 on: July 24, 2015, 08:52:54 AM »
Good question. I' currently experiencing that the rigidbodies are reacting on gravity in my UIScrollList. I'm not sure if it is related to Unity 5.1.2, but we hadn't had that problem before.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Rigidbody on UIPanel still needed?
« Reply #2 on: July 24, 2015, 10:58:43 AM »
As I understand it, it's recommended to have at least one rigidbody per group of colliders. Moving a rigidbody is also faster than moving a collider, so if you happen to be moving panels around, slap a rigidbody on them. The reason you don't get new rigidbodies on child panels is because you already have one rigidbody in the hierarchy. If you remove the root's rigidbody, your child panels will start getting them.

As for gravity, check your rigidbody settings. All rigidbodies used by UI should be kinematic = no gravity.