I am learning Amethyst framework for Rust. And now I follow pong tutorial here. On step 3 (Moving paddles) tutorial teaches how to set up System for moving paddles. I followed all the steps, however when I cargo run my application i get an error:

thread 'main' panicked at 'Cannot insert multiple systems with the same name ("parent_hierarchy_system")', /home/path_to_cargo/shred-0.9.4/src/dispatch/builder.rs:172:17

I tried just to copy from GitHub repository of tutorial but get the same result.

My Cargo.toml looks:

[package]
name = "pong"
version = "0.1.0"
authors = []
edition = "2018"

[dependencies.amethyst]
version = "0.13"
features = ["vulkan"]

I run the project on Ubuntu 19.10. Rust version 1.37.

My guess is that input_system is somehow added twice when running. I have searched both tutorial repository for the same issue and the web. But it seems I am the only one who faced it. Perhaps solution is very easy but I have spent my Saturday trying to fix it.

let game_data = GameDataBuilder::default()
    .with_bundle(TransformBundle::new())?
    .with_bundle(input_bundle)?
    .with(systems::PaddleSystem, "paddle_system", &["input_system"]) // Add this line
    .with_bundle(
        RenderingBundle::<DefaultBackend>::new()
            .with_plugin(
                RenderToWindow::from_config_path(display_config_path)
                    .with_clear([0.0, 0.0, 0.0, 1.0]),
            )
            // RenderFlat2D plugin is used to render entities with a `SpriteRender` component.
            .with_plugin(RenderFlat2D::default()),
        )?
    .with_bundle(TransformBundle::new())?;

The code of my GameDataBuilder initialization.

1

There are 1 best solutions below

0
On BEST ANSWER

You have added the TransformBundle twice.

Removing one will remove this error.