Without this helper, creators have to resort to the following:
export function checkForChanges() {
for (const [entity] of engine.getEntitiesWith(CustomComponent)) {
// check for changes
}
}
engine.addSystem(checkForChanges)
This seems to be due to an underlying bug affecting a variety of the already-existing components, not just the custom ones.
E.g., PlayerEquippedData is not working as expected in this example.
Today, the onChange function only works on native SDK components. It would be ideal for it to also work on any custom component defined in the scene.
here's a snippet to show that it doesn't work today:
Without this helper, creators have to resort to the following: