Skip to content

Add component to entity using world possible? #6758

Answered by james7132
Schr3da asked this question in Q&A
Discussion options

You must be logged in to vote

If you know an entity already exists, you can use World::entity_mut to get an EntityMut for that entity.

world
    .entity_mut(entity)
    .insert(Position { x: row, y: column });

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@Schr3da
Comment options

@hymm
Comment options

hymm Nov 25, 2022
Collaborator

@Schr3da
Comment options

Answer selected by Schr3da
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants