Search Unity

Question Unity preloading prefab memory issue (Android)

Discussion in 'Prefabs' started by Chloe_Zoomob, Oct 18, 2022.

  1. Chloe_Zoomob

    Chloe_Zoomob

    Joined:
    Dec 7, 2021
    Posts:
    4
    image_2022_10_18T08_39_54_196Z.png I am currently working on a battle simulation game, I used a plugin to help me solve the performance issue when rendering a lot of the same model at the same time (e.g. 300 archer), but it doesn't help much when they are different models (e.g. archer + rider + knight + 50 other types of soldiers). Even if I didn't instantiate the model into the scene, by just keep the reference in one of the model spawning scripts, Unity seems to preload all the models into the memory and crash some of the low end Android device.

    Does anyone know any tip and tricks that can help solving this issue?
     
  2. Neto_Kokku

    Neto_Kokku

    Joined:
    Feb 15, 2018
    Posts:
    1,751
    If you want to be able do dynamically load and unload prefabs, look into how to use the addressable assets package.
     
  3. Chloe_Zoomob

    Chloe_Zoomob

    Joined:
    Dec 7, 2021
    Posts:
    4
    Didn't realize direct reference will cause such issue, thanks for the suggestions!