aevyrie / bevy_mod_picking

Picking and pointer events for Bevy.
https://crates.io/crates/bevy_mod_picking
Apache License 2.0
791 stars 174 forks source link

RaycastPickCamera needs to be attached to the camera? #264

Closed maaku closed 11 months ago

maaku commented 1 year ago

I'm trying to integrate bevy_mod_picker into my project, using the examples as a guide. However user input events are not being generated for my application. The debug overlay correctly shows the cursor and button state, but On::<Pointer<Click>>::... actions are not being executed.

My application has a splash screen, which is the initial State (using bevy_ui). Upon clicking through to the application itself we change from the SplashScreen to Active state. Examining the debug log, I see that during the splash screen events are being triggered, but during the Active state they are not.

I don't see any reason why bevy_mod_picking should care what state my application is in. I'm new to bevy though, so I'm not sure if this is a bug or just me using it wrong. Is there any logic in changing States which bevy_mod_picker needs to be informed of?

maaku commented 1 year ago

So I didn't instantiate a RaycastPickCamera component on my Camera3dBundle. Before I close this issue though, I have some questions.

Notably the README gives an example usage in the "Getting Started" section which is how I found my bug. But none of the example programs do this. Why is that? Why does picking work in my splash screen but not the 3D camera view?

mattdm commented 1 year ago

Can you post your code (or a minimal example of the problem) to https://discord.com/channels/691052431525675048/1038322714320052304? Better for narrowing things down than a GitHub issue....

I'm not an expert in this, but we're both experienced in being confused in getting started, which puts us in a good position to improve the docs. :)

aevyrie commented 1 year ago

This plugin knows nothing about your application's states.

What version of the plugin are you using? If you're looking at the examples and readme on git main, then you're looking at version 0.16.0-dev, which is not compatible with the last release on crates.io.

There was an error in the readme which has now been fixed.

aevyrie commented 11 months ago

Closing, as this sounds like a misunderstanding of documentation between the development branch and released versions.