PROMETHIA-27 / bevy_mod_wanderlust

Apache License 2.0
66 stars 12 forks source link

Unable to add to plugin to app #25

Closed davids91 closed 1 year ago

davids91 commented 1 year ago

Hi! Now that I've had the chance to run the examples I see this control is awesome! I would love to use it in my projects, but unable to set it up for some reason ..

Cargo.toml:

[package]
name = "main"
version = "0.1.0"
edition = "2021"

[workspace]
resolver = "2" # Important! wgpu/Bevy needs this!

[dependencies]
bevy = { version = "0.10", features = [
    "bevy_render",
] }
bevy_rapier3d = { version = "0.21", features = [
    "async-collider",
    "dim3",
] }
bevy_prototype_debug_lines = { version = "0.10", features = [
    "3d",
], optional = true }
bevy_mod_wanderlust = "0.2.2"

[dev-dependencies]
bevy = "0.10"
bevy_editor_pls = "0.4"
bevy_rapier3d = { version = "0.21", features = ["debug-render"] }

# Enable a small amount of optimization in debug mode
[profile.dev]
opt-level = 1

# Enable high optimizations for dependencies (incl. Bevy), but not for our code:
[profile.dev.package."*"]
opt-level = 3

The following main.rs:


use bevy_mod_wanderlust::WanderlustPlugin;
fn main() {
    bevy::app::App::new()
        .add_plugin(WanderlustPlugin)
        .run();
}

Produces the compile error:

    Checking main v0.1.0 
error: src/main.rs:5: the trait bound `WanderlustPlugin: Plugin` is not satisfied
error: src/main.rs:5: the trait `Plugin` is not implemented for `WanderlustPlugin`
error: src/main.rs:5: required by a bound introduced by this call
help: src/main.rs:5: the following other types implement trait `Plugin`:
  AnimationPlugin
  AssetCountDiagnosticsPlugin<T>
  AssetPlugin
  AudioPlugin
  BlitPlugin
  BloomPlugin
  CameraPlugin
  CameraProjectionPlugin<T>
and 55 others
...
error: could not compile `main` due to 2 previous errors
PROMETHIA-27 commented 1 year ago

Ah. This is because while wanderlust depends on bevy 0.10 on main, it does not on crates.io as I haven't uploaded a new version in a while, so your 0.10 plugin trait is not matching up with wanderlust's 0.8 plugin trait.

To fix this, depend on wanderlust with bevy_mod_wanderlust = { git = "https://github.com/PROMETHIA-27/bevy_mod_wanderlust.git" } That should fix the problem if I'm not mistaken.

I'll do my best to revisit wanderlust again and maybe add some features/fix some bugs, and upload the latest version to crates.io. Might take a week or so at most, assuming I don't forget.

davids91 commented 1 year ago

Awesome! This works! :) I'll be watching the Repo for any updates; Thank you for your help!