-
Notifications
You must be signed in to change notification settings - Fork 73
Add and Remove Component from Entity
Andrea Catania edited this page Jun 8, 2021
·
1 revision
You can add or remove Components directly from a System using the Storage<ComponentName>.
/// Add the Winner component to the Red team
void my_system(Query<EntityID, RedTeam> &p_query, Storage<Winner> *p_winners_storage) {
for (auto [entity, red_team] : p_query) {
p_winners_storage->insert(entity, Winner());
}
}However, when you don't know the exact component to add or remove when you write your system, you can use a Spawner
Community & Support
- Open an issue
- Join the Discord Community
- Start a new discussion
- Home
- Getting Started
- Concepts
- Godot & Godex communication
- Godex Importer
- Bullet Physics Engine
- Classes
Support
Useful links