Skip to content

Cannot easily spawn an entity with one component #607

Closed
@smokku

Description

@smokku

If I try spawning an entity with just one component, I get the following error:

error[E0277]: the trait bound `Pawn: bevy::bevy_ecs::DynamicBundle` is not satisfied
  --> examples/balls.rs:69:20
   |
69 |     commands.spawn(Pawn { controller: 1 }).with(Ball {
   |                    ^^^^^^^^^^^^^^^^^^^^^^ the trait `bevy::bevy_ecs::DynamicBundle` is not implemented for `Pawn`

I need to spawn a one element tuple:

commands.spawn((Pawn { controller: 1 },)).with(Ball {

There is no way of coming up to that solution from the error message.

Bevy's selling point is ECS ergonomics - i think this needs to be fixed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ECSEntities, components, systems, and eventsC-FeatureA new feature, making something new possibleC-UsabilityA targeted quality-of-life change that makes Bevy easier to use

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions