SanderMertens / flecs

A fast entity component system (ECS) for C & C++

Home Page:https://www.flecs.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

observers do not handle OnSet of components on an instance of a prefab that are added with .mut(world)

Lost-Boy-Jason opened this issue · comments

Describe the bug
Observers will not handle observing OnSet on instances of components that are set on the prefab of an instance by calling .mut(world) on the prefab and setting the instance.

To Reproduce
Steps to reproduce the behavior:

  1. make a prefab that has one component set when initialized
  2. modify the prefab by setting another component by calling .mut(world).set
  3. make two observers for instances of the prefab, one for each component
  4. instance the prefab
  5. the OnSet observer for the first component will trigger, the OnSet observer for the second component will not.

Expected behavior
the OnSet observer for each component will trigger, as both components are set on instancing

Additional context
repro in text file
OnSetBug.txt

Fixed!