Skip to content

Conversation

@krispya
Copy link
Member

@krispya krispya commented Jan 27, 2026

Using multiple traits in a tracking modifier works, but it uses logical AND. There is no way to track with a logical OR. This PR lets you do that using the Or operator. Works for changed, added and removed.

// Track entities where BOTH Position AND Velocity have changed
const fullyUpdated = world.query(Changed(Position, Velocity))

// Track entities where EITHER Position OR Velocity has changed
const eitherChanged = world.query(Or(Changed(Position), Changed(Velocity)))

@krispya krispya changed the title feat: Implement tracking modifiers in Or feat: Tracking modifiers with logical OR Jan 27, 2026
@krispya krispya merged commit 31cbe9a into main Jan 27, 2026
1 check passed
@krispya krispya deleted the feat/nested-or-modifiers branch January 27, 2026 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants