Search Unity

Performance SetActive, Instantiate & Destroy, Moving object out of screen.

Discussion in 'WebGL' started by Avol, May 8, 2018.

  1. Avol

    Avol

    Joined:
    May 27, 2016
    Posts:
    46
    I built a damage manager class which handles hundreds of bullets, impact game objects, muzzles etc. What it does it creates hundreds of game objects and deactivates / activates when needed as that should provide better performance than instantiating and destroying them, also calls update on all objects from a single Update() mono event. What I was wondering, would it have better performance to move all of those objects out of screen instead of enabling disabling them? Assuming all the game objects don't use any mono events besides Start(). As it's a WebGL game all the performance gain and avoiding spikes in frame rate is crucial.