Update query.md - formatting
Some checks are pending
analysis / Run Luau Analyze (push) Waiting to run
deploy-docs / build (push) Waiting to run
deploy-docs / Deploy (push) Blocked by required conditions
publish-npm / publish (push) Waiting to run
unit-testing / Run Luau Tests (push) Waiting to run

This commit is contained in:
EncodedVenom 2025-07-26 18:55:38 -04:00 committed by GitHub
parent 0606bf70f0
commit 998b1d3528
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -13,6 +13,8 @@ function Query:cached(): Query -- Returns the cached Query
``` ```
Example: Example:
::: code-group
```luau [luau] ```luau [luau]
local lerps = world:query(Lerp):cached() -- Ensure that you cache this outside a system so you do not create a new cache for a query every frame local lerps = world:query(Lerp):cached() -- Ensure that you cache this outside a system so you do not create a new cache for a query every frame
@ -31,6 +33,9 @@ function system(dt) {
// Do something // Do something
} }
} }
```
:::
## with ## with
@ -142,4 +147,4 @@ local iterator = query:iter()
for entity, position, velocity in iterator do for entity, position, velocity in iterator do
-- Process entity -- Process entity
end end
``` ```