godot
godot copied to clipboard
Bodies collide but are not affected otherwise on certain collision mask setups (2D physics)
Tested versions
Reproducible in Godot v4.2.2.stable
System information
Godot v4.2.2.stable - macOS 14.6.1 - Vulkan (Forward+) - integrated Apple M2 Pro - Apple M2 Pro (10 Threads)
Issue description
Setup:
- I have a basic setup with ball and platform that can move (connected with a soft pin joint)
- I expect the ball to push the platform down when landing on it
- In all cases the bodies collide, but in some the "pushing down“ aspect doesn’t work (case 2)
Confusion:
It works depending on the collision layer and mask setup, but I’d have expected for case 2 to work as well (because also the collision works).
Context:
I am not sure if this a bug or intended behaviour, because they do collide but not interact as expected. The documentation says the following but only about colliding:
This describes what layers the body will scan for collisions. If an object isn't in one of the mask layers, the body will ignore it. By default, all bodies scan layer 1.
So if it’s not intended it might also be a joint bug.
Might be related to other issues such as #70671
Steps to reproduce
For the „fail“ case:
- Create ball with a RigidBody2D (set collision layer to 2 and collision mask to 1 and 2)
- Create a platform with a RigidBody2D (leave collision settings at 1)
- Create a StaticBody2D as well as a PinJoint2D
- Connect the pin joint to the platform and the static body
- Set the joint’s softness to 16
- Watch the bodies collide but without the platform moving
- Note: Whether the static body you connect joints to has a collision shape or not doesn’t matter