bevyengine / bevyengine/bevy

'2D Viewport To World' example doesn't follow API docs recommendation

Open
#19,416 1 comment 0 reactions 0 assignees View on GitHub
A-Input A-Time C-Docs C-Examples S-Needs-Design X-Uncontroversial
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 16h
Merged PRs (30d)
171

Description

## How can Bevy's documentation be improved?

https://bevyengine.org/examples/2d-rendering/2d-viewport-to-world/

This example adds an input handling system like so: `.add_systems(FixedUpdate, controls)`.
It uses the [`FixedUpdate`](https://docs.rs/bevy/latest/bevy/app/struct.FixedUpdate.html) schedule for this. However, the documentation for the [`Update`](https://docs.rs/bevy/latest/bevy/prelude/struct.Update.html) schedule suggests that _it_ should be used for input handling functions instead. Furthermore, the `FixedUpdate` documentation links to `Update` for "examples of systems that _should not_ use this schedule," so this might cause some confusion.

I'm assuming the API documentation is correct but I don't know whether the example is. I suggest one of these changes:
- If the example's choice of schedule for this system is indeed the preferred option, it should explain why it chooses to deviate from the recommended usage of the schedules per the API docs in a code comment.
- If the example's choice of schedule for this system is incorrect or inconsequential, it should follow the recommendations of the API docs for consistency.

Contributor guide

Open the contributing guide

Research direction

Start with the 2D Viewport To World example at the linked URL, then read the linked Update and FixedUpdate API documentation. Determine whether the controls system should use Update or retain FixedUpdate, and make the example and its explanation consistent with that decision.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.