Search Unity

Force Unique not work When Instantiate ?

Discussion in 'Physics for ECS' started by lijianfeng, Mar 13, 2020.

  1. lijianfeng

    lijianfeng

    Joined:
    Sep 8, 2015
    Posts:
    54
    When I Instantiate multiple entities come from prefab entity, these entites all reference to the same collider of the prefab entity.:(
     
  2. Adam-Mechtley

    Adam-Mechtley

    Administrator

    Joined:
    Feb 5, 2007
    Posts:
    290
    Yes for now the "Force Unique" concept only has effect during conversion (i.e. two GameObjects with otherwise same inputs will convert into unique BlobAssets). The concept no longer exists at run-time. It's on our roadmap to evaluate a proper design for mutable colliders, but in the meantime you will need to make your own copies at run-time if you plan to make modifications to individual instances (and respectively need to manage their lifetime)
     
  3. LevonVH

    LevonVH

    Joined:
    Dec 16, 2016
    Posts:
    19
    I made a trigger volume that modifies the collision filter of the entered collider and resets the filter when the collider has left the volume. This will allow me to create some "holes" in a surface collider without using a mesh collider. The only issue is that if the collider that has entered the volume belongs to multiple objects. So if the collision filter is changed for the collider that has entered the volume, it also changes for many other objects, which is not the intended behavior. Is there any way of making the colliders unique in the runtime and what kind of impact would it have on the performance?
     
    Last edited: Sep 9, 2020
  4. djsell

    djsell

    Joined:
    Aug 29, 2013
    Posts:
    77
    I feel like this should be mentioned in documentation or included in the tooltip for Force Unique. It's a little unintuitive and tripped me up as well a few weeks back.
     
  5. zaaasgames

    zaaasgames

    Joined:
    Apr 12, 2020
    Posts:
    7
    Just want to reiterate that Force Unique not actually being unique at runtime is extremely unintuitive and should at least be indicated in the documentation or the tooltip. I just spent several hours figuring this out the hard way.
     
    HiddenTess and IsaacsUnity like this.