Skip to content

Conversation

@Niyudi
Copy link
Contributor

@Niyudi Niyudi commented Oct 9, 2025

Objective

Addresses #21467.

Solution

Adds the "free_cam_controller" example, that contains a simple scene with a camera controlled by the FreeCamPlugin. the code explains how to change the settings in the FreeCam component and the example provides bindings to change sensitivity and friction live.

Testing

cargo run --example free_cam_controller --features="free_cam"

As this is my first contribution to the project, please let me know about any problems.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 9, 2025

Welcome, new contributor!

Please make sure you've read our contributing guide and we look forward to reviewing your pull request shortly ✨

@janis-bhm janis-bhm added C-Examples An addition or correction to our examples A-Dev-Tools Tools used to debug Bevy applications. S-Needs-Review Needs reviewer attention (from anyone!) to move forward A-Camera User-facing camera APIs and controllers. labels Oct 9, 2025
@janis-bhm
Copy link
Contributor

Over all this looks solid to me, however here are a few things I noticed while testing this out:

Opening this example, I am familiar with bevy's camera controls, but I think it would be useful to have the UI tell the user which keys manipulate the camera; FlyCam implements Display for this purpose.

Currently this only shows how to change the sensitivity and friction at runtime, but there are more knobs to turn on the fly cam. Personally, I think at least enabling and disabling the cam could be demonstrated, as well as mentioning scroll_factor along side the walk and run speeds.

@Niyudi
Copy link
Contributor Author

Niyudi commented Oct 9, 2025

Implemented your suggestions!

Copy link
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, this is pretty much exactly what I was hoping for. Thanks!

@alice-i-cecile alice-i-cecile added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Oct 9, 2025
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Oct 9, 2025
Merged via the queue into bevyengine:main with commit 7376755 Oct 9, 2025
42 checks passed
github-merge-queue bot pushed a commit that referenced this pull request Oct 10, 2025
…is disabled (#21485)

# Objective
Fixes #21482

## Solution
Before exiting the system when the controller is disabled, check if
either of the cursor grab flags are set and ungrab any windows if so.
Note: I think it's a bit strange that the camera un-grabs every window,
not just the one with focus, but I've just copied this behaviour from
further down in the function. In this case, it might be more correct to
do this anyway, since the controller might be disabled when the
respective window isn't focused.

## Testing

I used #21477 to test this
mate-h pushed a commit to mate-h/bevy that referenced this pull request Oct 22, 2025
# Objective

Addresses bevyengine#21467.

## Solution

Adds the "free_cam_controller" example, that contains a simple scene
with a camera controlled by the FreeCamPlugin. the code explains how to
change the settings in the FreeCam component and the example provides
bindings to change sensitivity and friction live.

## Testing

`cargo run --example free_cam_controller --features="free_cam"`

As this is my first contribution to the project, please let me know
about any problems.

---------

Co-authored-by: Alice Cecile <[email protected]>
mate-h pushed a commit to mate-h/bevy that referenced this pull request Oct 22, 2025
…is disabled (bevyengine#21485)

# Objective
Fixes bevyengine#21482

## Solution
Before exiting the system when the controller is disabled, check if
either of the cursor grab flags are set and ungrab any windows if so.
Note: I think it's a bit strange that the camera un-grabs every window,
not just the one with focus, but I've just copied this behaviour from
further down in the function. In this case, it might be more correct to
do this anyway, since the controller might be disabled when the
respective window isn't focused.

## Testing

I used bevyengine#21477 to test this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Camera User-facing camera APIs and controllers. A-Dev-Tools Tools used to debug Bevy applications. C-Examples An addition or correction to our examples S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants