#Error when trying to instantiate a prefab using Particles, after changing scene. In build

1 messages · Page 1 of 1 (latest)

thorn pendant
#

An entity prefab is baked into a component using EntityPrefabReference. Then it gets loaded and ready to be instantiated. If the current scene is changed, then any attempt to instantiate the prefab will result in error

NullReferenceException: Object reference not set to an instance of an object
at Unity.Entities.AttachToEntityClonerInjection.InstantiateCompanionComponentDelegate

  • Issue does not happen in the editor
  • Unity 6.0.31 (but it also happens in 2022.3.x)
  • Entities 1.3.8 (but it also happens with previous versions)

How to reproduce

thorn pendant
#

Error when trying to instantiate a prefab using Particles, after changing scene. In build