Search Unity

Questio about pooling prefab variants

Discussion in 'Prefabs' started by Oshigawa, Aug 24, 2018.

  1. Oshigawa

    Oshigawa

    Joined:
    Jan 26, 2016
    Posts:
    362
    Hello,

    i was just wondering if anyone tried how the pooling would work with prefab variants? Basically it's the same object with differences in components/component values. Since i have to put both the original and the variant in the pool to have them pooled, is there way around this to reduce the number of pooled objects since the variant uses the original as base?
     
  2. runevision

    runevision

    Joined:
    Nov 28, 2007
    Posts:
    1,892
    Hi. I don't understand your use case exactly, but I'm guessing you're using pooling for runtime instantiation of Prefabs?

    Most of the Prefab features like overrides, nested Prefab, Prefab Variants etc. don't exist at runtime and so you won't be able to take advantage of them in any way when instantiating Prefabs at runtime. All the new functionality is Editor-only.
     
    phobos2077 and Oshigawa like this.
  3. Oshigawa

    Oshigawa

    Joined:
    Jan 26, 2016
    Posts:
    362
    Ah, ok, now i get it. Thanks!