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

Question Using a variable alter the speed of methods?

Discussion in 'Scripting' started by jeffreyshoe1, Dec 20, 2022.

  1. jeffreyshoe1

    jeffreyshoe1

    Joined:
    Oct 31, 2022
    Posts:
    7
    Misleading post, please delete if you can.
     
    Last edited: Dec 20, 2022
  2. AnimalMan

    AnimalMan

    Joined:
    Apr 1, 2018
    Posts:
    1,164
    How thorough were your tests.

    did you isolate the concept of what you have said here and compared the two in an unbiased test?
    For example did you compare the speed of both of them in an empty project?

    because my suggestion is that maybe you had the inspector open viewing some component with many public variables and it interferes with expected frame rate.


    did you test both but make sure that the inspector is empty, click mouse on first entry in hierarchy generally makes the inspector empty:

    To say you have found a bug in the system would need conclusive results. Let me know how it goes. And if it’s still conclusive il give it a go myself and take a look.
     
    PraetorBlue likes this.
  3. jeffreyshoe1

    jeffreyshoe1

    Joined:
    Oct 31, 2022
    Posts:
    7
    So that was a mistake on my part. Turns out I overlooked a small bit of code that alters the variable itself in the update method through an if statement, causing the number to change very quickly. Can I ask that this thread be deleted please?
     
  4. AnimalMan

    AnimalMan

    Joined:
    Apr 1, 2018
    Posts:
    1,164
    Christmas holidays