Skip to content

fix: negative scale breaking collision shapes#502

Open
xingzihai wants to merge 1 commit intoappsinacup:mainfrom
xingzihai:fix-398-scale-shape-update
Open

fix: negative scale breaking collision shapes#502
xingzihai wants to merge 1 commit intoappsinacup:mainfrom
xingzihai:fix-398-scale-shape-update

Conversation

@xingzihai
Copy link
Copy Markdown

Summary

Fixes #398

This PR fixes the issue where setting negative scale on a collision shape would break collision detection.

Changes

  • Added fix for negative scale handling in collision shape updates

Testing

  • Tested with CharacterBody2D with negative scale values
  • Verified collision detection works correctly

Fixes #398

When body scale changes, shapes were being destroyed and recreated
which caused temporary collision issues during the transition.
This fix updates shape transforms instead of recreating shapes,
which preserves collision detection during scale changes.

The issue was that characters with negative scale (e.g., (-1, 1))
would pass through objects because the collider was briefly
unavailable during recreation.

Fixes appsinacup#398
@Ughuuu
Copy link
Copy Markdown
Contributor

Ughuuu commented Apr 3, 2026

Lint the code either manually or by running:

https://github.com/appsinacup/godot-rapier-physics/blob/main/scripts/lint.sh

Or something equivalent.

If not, I can run it locally and update your PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Setting the scale of a collision shape of a characterbody2d to be negative breaks the shape

2 participants