godotengine / godotengine/godot

CollisionPolygon2D sprite doesn't follow parent when set to "Top Level" while "Visible Collision Shapes" is on, although parent still collides.

Open
#95,641 0 comments 0 reactions 0 assignees View on GitHub
bug needs testing topic:2d
Dominant language
C++
Stars
117k
Forks
26.8k
PR merge metrics
PR metrics pending

Description

### Tested versions

Done in 4.3, vaguely remember this not being an issue in 4.2.x

### System information

Godot v4.3.stable (77dcf97d8) - Windows 10.0.22631 - Vulkan (Forward+) - integrated AMD Radeon(TM) Graphics (Advanced Micro Devices, Inc.; 31.0.12042.4) - AMD Ryzen 5 5600G with Radeon Graphics (12 Threads)

### Issue description

As the title says. This doesn't happen when set to "Show Behind", nor does it happen with CollisionShape2D.

![image](https://github.com/user-attachments/assets/84699363-9ea8-4a56-93fd-74f750c91dae)
As you can see, I can still manipulate the small object (which has gravity) by balancing it on top of me, showing I still have collision, while the sprite of the CollisionPolygon2D just hangs there.

![image](https://github.com/user-attachments/assets/bd97ab85-71b3-4575-a593-30a95d5c3f65)
This also happens in the editor when moving the parent, which the child should follow. (The marker is for the Node2D and background)

### Steps to reproduce

Just make a CharacterBody2D with some movement code and give it a CollisionPolygon2D as a child on the top level, while having visible collision shapes. The parent still collides according to the shape of the CollisionPolygon2D, but the sprite doesn't move. Just a small oversight in the source code, I assume.

### Minimal reproduction project (MRP)

[ayo-4.3.zip](https://github.com/user-attachments/files/16638325/ayo-4.3.zip)

No clue if I did it right. The description above should suffice though.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.