query
query<
Cs>(…components):Query<Cs>
Defined in: src/query.ts:428
Creates a new query for the specified components and/or pairs.
Type Parameters
Section titled “Type Parameters”Cs extends ZeroUpToEight<Pair<unknown> | ComponentHandle<unknown>>
Parameters
Section titled “Parameters”components
Section titled “components”…Cs
Returns
Section titled “Returns”Query<Cs>
Example
Section titled “Example”const Position = component<Vector3>()const Velocity = component<Vector3>()
function updatePositions() { query(Position, Velocity).forEach((entity, position, velocity) => { entity.set(Position, position.add(velocity)) })}