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. Dismiss Notice

Optimization question

Discussion in 'Scripting' started by unity_1236alman, Dec 25, 2020.

  1. unity_1236alman

    unity_1236alman

    Joined:
    Mar 4, 2019
    Posts:
    66
    Is the overlap.. method too heavy for the update? Im working on a mobile project, and the overlap should return at least 5 colliders at time. If yes, what can be a valid alternative?
     
  2. Antistone

    Antistone

    Joined:
    Feb 22, 2014
    Posts:
    2,833
    I have no specific knowledge that directly answers your question, but considering that Unity has to check collisions of all colliders every frame just for basic physics stuff, I see no obvious reason that would be a problem. Have you tried it?
     
  3. unity_1236alman

    unity_1236alman

    Joined:
    Mar 4, 2019
    Posts:
    66
    Yes but the game is very simple, i don't see differences
     
  4. csofranz

    csofranz

    Joined:
    Apr 29, 2017
    Posts:
    1,556
    I recommend you only look at specific functions if and when the Profiler indicates that there is lots of cycles lost there. Otherwise you are likely to engage in premature optimization.