bevyengine / bevyengine/bevy

Add a Option to disable Transform Propagation

Open
#9,228 6 comments 1 reaction 0 assignees View on GitHub
A-Transform C-Usability 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?

For example, I want to code a Snake game and implement the movement of the snake body using a `LinkedList` (where every tick, the tail entity is despawned and a new one is spawned at the head). Initially, I put this `LinkedList` into a struct (component) called Snake, but it seemed like an object-oriented programming (OOP) approach. However, since I want to use the Entity Component System (ECS), I decided to remove the `LinkedList` and instead simulate it using Bevy's parent and children system (where the head has no parent and the tail has no children).

However, when I attempted to move the snake body using this approach, I encountered a problem. Since every entity's transform is based on its own parent, the snake body started moving in a comical manner. Therefore, I want to disable the Transform Propagation.

## What solution would you like?

~I would like to add a Resource with a boolean field that can enable or disable Transform Propagation.~

A new NoPropagate-type component could be added to entities that shouldn't have their transform propagated, and adjust the propagation system to handle it with Without.

## Additional context

**Although I can define a component called Next to simulate the LinkedList and eventually implement them, I would still like to offer some advice.**

Ultimately, the decision is up to you.

Contributor guide

Open the contributing guide

Research direction

Start with Bevy's Transform Propagation and parent/children system described in the issue. Compare the proposed resource and NoPropagate component approaches, then define the behavior that prevents unwanted propagation; done means the chosen opt-out behavior is implemented and verified for the snake-style hierarchy.

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
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.