We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug Observers don't trigger for override components added from a prefab. Behaviour is as expected in v3.2.11.
To Reproduce Edited flecs/examples/cpp/prefabs/src/main.cpp
flecs/examples/cpp/prefabs/src/main.cpp
#include <basics.h> #include <iostream> struct Defense { double value; }; struct Armour { double value; }; int main() { flecs::world ecs; // inherited components trigger observer //ecs.component<Defense>().add(flecs::OnInstantiate, flecs::Inherit); //ecs.component<Armour>().add(flecs::OnInstantiate, flecs::Inherit); ecs.observer<const Defense, Armour>("CalculateArmour") .event(flecs::OnSet) .each([&](const Defense& defense, Armour& armour) { armour.value = 1.0 / defense.value; std::cout << "observer trigger\n"; }); // Create a SpaceShip prefab with a Defense component. std::cout << "make prefab\n"; flecs::entity SpaceShip = ecs.prefab("SpaceShip") .set<Defense>({ 50 }) .set(Armour{}); // Create a prefab instance std::cout << "make prefab instance\n"; flecs::entity inst = ecs.entity("my_spaceship").is_a(SpaceShip); // calling modified triggers the observer as expected //inst.modified<Armour>(); }
Expected output (v3.2.11)
make prefab make prefab instance observer trigger
Actual output
make prefab make prefab instance
The text was updated successfully, but these errors were encountered:
#1413 Fix issue where (OnInstantiate, Override) would not trigger OnSet
f906a4d
e38ea92
d2935ce
Fixed!
Sorry, something went wrong.
No branches or pull requests
Describe the bug
Observers don't trigger for override components added from a prefab. Behaviour is as expected in v3.2.11.
To Reproduce
Edited
flecs/examples/cpp/prefabs/src/main.cpp
Expected output (v3.2.11)
make prefab
make prefab instance
observer trigger
Actual output
make prefab
make prefab instance
The text was updated successfully, but these errors were encountered: