Skip to content

Fix switching between earth/mars in atmosphere example#24349

Merged
mockersf merged 1 commit into
bevyengine:mainfrom
KategoryBee:atmosphere-fix
May 21, 2026
Merged

Fix switching between earth/mars in atmosphere example#24349
mockersf merged 1 commit into
bevyengine:mainfrom
KategoryBee:atmosphere-fix

Conversation

@KategoryBee
Copy link
Copy Markdown

Objective

The keys for switching between earth and mars atmospheres in the atmosphere example currently do nothing. This change restores the functionality.

I'm guessing the issue is from the Atmosphere component changing from using Transform to GlobalTransform directly in Atmosphere::set_default_transform. The example is expecting to iterate over a Transform, never finds one, and thus never changes the atmosphere.

Solution

Change the example to modify GlobalTransform instead of Transform.

It may be preferable to modify the example to insert a Transform in set-up. Let me know if this is the case and i'll update the PR.

Testing

  • Tested by running the atmosphere example, hitting the 3 and 4 keys and seeing sufficiently earth and mars like atmospheres, as well as messages in the console.

@github-actions
Copy link
Copy Markdown
Contributor

Welcome, new contributor!

Please make sure you've read our contributing guide, as well as our policy regarding AI usage, and we look forward to reviewing your pull request shortly ✨

@SludgePhD
Copy link
Copy Markdown
Contributor

Calling single_mut() on the queries instead of iterating would cause a fatal error instead of doing nothing. Might be worth doing, to make issues like this more noticeable.

@kfc35 kfc35 added A-Rendering Drawing game state to the screen C-Examples An addition or correction to our examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels May 19, 2026
@github-project-automation github-project-automation Bot moved this to Needs SME Triage in Rendering May 19, 2026
@kfc35 kfc35 added the D-Trivial Nice and easy! A great choice to get started with Bevy label May 21, 2026
@kfc35 kfc35 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 May 21, 2026
@mockersf mockersf added this pull request to the merge queue May 21, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 21, 2026
@mockersf mockersf added this pull request to the merge queue May 21, 2026
Merged via the queue into bevyengine:main with commit c046ff2 May 21, 2026
49 checks passed
@github-project-automation github-project-automation Bot moved this from Needs SME Triage to Done in Rendering May 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Rendering Drawing game state to the screen C-Examples An addition or correction to our examples D-Trivial Nice and easy! A great choice to get started with Bevy S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants