Hi guys! I created a platform (RigidBody) attached to a static body through a PinJoint2D in order to work like a pendulum for my 2D game. However, I'm having an issue when my player (KinematicBody) collides to that rigidbody. The player was suppose to stays over the platform, not fall off it. I already tried to change the attributes of the rigibody and the joint in order to fix that but the issue stills happening. Any clue about what is causing this behavior?
Scene structure and some nodes attributes:
So RigidBodies are fully controlled by the physics system. KinematicBodies are not. Meaning you are probably applying gravity yourself, which is custom and not part of the physics engine. So your custom gravity is overriding the physics engine and making the character fall. One way to work around this is where you would normally check is_on_floor() also do a ray cast (down) and check if you are touching any rigid bodies (and then set velocity.y to 0). I haven't tested this but it might work.
@cybereality said: So RigidBodies are fully controlled by the physics system. KinematicBodies are not. Meaning you are probably applying gravity yourself, which is custom and not part of the physics engine. So your custom gravity is overriding the physics engine and making the character fall. One way to work around this is where you would normally check is_on_floor() also do a ray cast (down) and check if you are touching any rigid bodies (and then set velocity.y to 0). I haven't testing this but it might work.
I gonna try that. Thank you @cybereality