bevyengine / bevyengine/bevy

Allow specifying which transform components are relative to the parent, and which are global

Open
#1,780 19 comments 27 reactions 0 assignees View on GitHub
A-Transform C-Feature C-Usability S-Needs-Design-Doc X-Needs-SME
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?

An example use case is a tank with a child turret entity. The turret should inherit location and scale from the tank, but should rotate independently.

## What solution would you like?

I believe this can be implemented by adding a new optional component to the turret:

```rust
TransformDescriptor {
translation: Local,
rotation: Global,
scale: Local
}
```

The `transform_propagate_system` could then look for this component and update the `GlobalTransform` accordingly.

_Note: I don't really like the name `TransformDescriptor` - can anyone think of better?_

## What alternative(s) have you considered?

There are two alternatives:
- Query for the parent's transform and subtract that from the turret's transform
- Parent both the tank and the turret to an empty, and use that for translation and scale.

Both of these are painful to use and don't take advantage of the ECS.

## Additional context

This is a feature that UE4 has

Contributor guide

Open the contributing guide

Research direction

Start by reading the existing transform_propagate_system and how GlobalTransform is updated. Evaluate the proposed TransformDescriptor semantics and naming against the tank-and-turret case, including the listed alternatives. Done means the design is settled and transform propagation supports independently selected local or global components with coverage for the example.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
game-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.