Author Topic: Expensive delayed cost using TweenScale  (Read 2201 times)

Krzycho

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 6
    • View Profile
Expensive delayed cost using TweenScale
« on: November 18, 2015, 09:00:05 AM »
Hey,
 Why do I get "Expensive delayed cost" on:
UITweener.Update(): Static Collider.Move and Static Collider.Modify
on every single update in profiler?

There is also GC Alloc once for a while on UITweener.Update(), which I also don't like.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Expensive delayed cost using TweenScale
« Reply #1 on: November 18, 2015, 04:12:58 PM »
You need to add a rigidbody somewhere in the UI's root hierarchy. NGUI does it by default -- generally placing it on the first panel it creates. If you remove that rigidbody, you will see this warning in Unity.

Krzycho

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 6
    • View Profile
Re: Expensive delayed cost using TweenScale
« Reply #2 on: November 19, 2015, 03:37:01 AM »
Thanks for the tip but it doesn't work to me. I've added RigidBody to the most top UIPanel in the hierarchy and there is no changes.
How about the GC stuff? Are you going to clean it up it the nearest future?
« Last Edit: November 20, 2015, 03:38:26 AM by Krzycho »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Expensive delayed cost using TweenScale
« Reply #3 on: November 25, 2015, 04:47:40 PM »
Then what's the tween on? The Unity is telling you that you are moving a collider that doesn't have a rigidbody on it. If it was a part of the UI hierarchy, you wouldn't see this after adding a rigidbody -- so the question becomes, what is that UITween on? Check, and make sure you have a rigidbody.