bevyengine / bevyengine/bevy

Update `GlobalTransform` as part of `FixedUpdate`

Open
#7,836 9 comments 0 reactions 0 assignees View on GitHub
A-Time A-Transform C-Usability D-Modest S-Blocked
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 16h
Merged PRs (30d)
171

Description

## What problem does this solve or what need does it fill?

The purpose of `FixedUpdate` and fixed timesteps in general is to improve determinism in systems, but any fixed update system relying on `GlobalTransform` will currently suffer from a lack of determinism if it runs multiple times in 1 frame.

## What solution would you like?

`GlobalTransform` should be updated between fixed updates.

## What alternative(s) have you considered?

Games could add these systems to `FixedUpdate` themselves. It's actually fairly easy to do already.

```
use bevy::{
prelude::*,
transform::systems::{propagate_transforms, sync_simple_transforms},
};

#[derive(Debug, Hash, PartialEq, Eq, Clone, SystemSet)]
pub enum FixedTransformSystem {
TransformPropagate,
}

// ...

app.add_system_to_schedule(
CoreSchedule::FixedUpdate,
sync_simple_transforms.in_set(FixedTransformSystem::TransformPropagate),
)
.add_system_to_schedule(
CoreSchedule::FixedUpdate,
propagate_transforms.in_set(FixedTransformSystem::TransformPropagate),
);
```

Contributor guide

Open the contributing guide

Research direction

Start with the transform systems `sync_simple_transforms` and `propagate_transforms`, then inspect how `FixedUpdate` schedules systems. Determine how `GlobalTransform` can be updated between fixed updates without disrupting existing scheduling. Done means fixed-update systems relying on `GlobalTransform` receive deterministic updates when a frame runs multiple fixed steps.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
game-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.