Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Are OnGUI() functions still a major performance hit?

Discussion in 'iOS and tvOS' started by avatara359, Jul 2, 2014.

  1. avatara359

    avatara359

    Joined:
    May 12, 2010
    Posts:
    41
    Years ago just having any script in your scene with an OnGUI() function in it was a significant performance hit on iOS. Was this ever fixed?
     
  2. DanielQuick

    DanielQuick

    Joined:
    Dec 31, 2010
    Posts:
    3,137
    Yes it is still a significant performance hit on any platform. In Unity 4.6 there will be a new Unity GUI (uGUI) to fix this.
     
  3. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    No, OnGUI isn't that big of a performance hit. The OnGUI system was re-written in C++ a while ago. The new GUI in 4.6 is primarily for design reasons; writing a GUI entirely in code has its place but is far from ideal in many cases.

    --Eric
     
  4. avatara359

    avatara359

    Joined:
    May 12, 2010
    Posts:
    41
    I use NGUI for GUI. But some of my addons have OnGUI calls and I was wondering if I need to spend time cutting those out. Thanks.
     
  5. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Very unlikely to be worth it.

    --Eric