How can I get components of an entity? #20437
-
I've seen #3332 but I could not figure out how this solution would fit into my program. I get this error:
This is due to including the mutable resources in my system parameters: fn handle_client_messages(
mut server: ResMut<QuinnetServer>,
mut players: ResMut<Players>,
world: &World,
) { I've tried just including the world parameter in my system and accessing resources through the World object but I get borrow checker errors. I've also seen #11587 and tried to use that, but that leads to me borrowing the world multiple times. let mut system_state: SystemState<(
ResMut<QuinnetServer>,
ResMut<Players>,
)> = SystemState::new(world);
let (mut server, mut players) = system_state.get_mut(world);
I am trying to write a system that can create a list of components of a specific entity for a multiplayer game. I thought that bevy_reflect might be a good fit for this, but I can't find any guides that align with my problem. Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You can use |
Beta Was this translation helpful? Give feedback.
You can use
world.resource_scope
. Check the linked docs for an example, and keep in mind that you can do multiple nested calls toresource_scope
:)