godot icon indicating copy to clipboard operation
godot copied to clipboard

Bodies collide but are not affected otherwise on certain collision mask setups (2D physics)

Open stephanbogner opened this issue 5 months ago • 4 comments

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).

Bildschirmfoto 2024-09-23 um 10 54 43

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:

  1. Create ball with a RigidBody2D (set collision layer to 2 and collision mask to 1 and 2)
  2. Create a platform with a RigidBody2D (leave collision settings at 1)
  3. Create a StaticBody2D as well as a PinJoint2D
  4. Connect the pin joint to the platform and the static body
  5. Set the joint’s softness to 16
  6. Watch the bodies collide but without the platform moving
  7. Note: Whether the static body you connect joints to has a collision shape or not doesn’t matter

Minimal reproduction project (MRP)

physics-layer-test.zip

stephanbogner avatar Sep 23 '24 09:09 stephanbogner