0 votes

I have a perfectly aligned sprite and CollisionArea2D making a moving platform in Godot. Even so, a RigidBody2D sitting on top of the platform seems to sink into the kinematic body.

https://i.stack.imgur.com/VkU07.png

As you can see, the ball has penetrated inside the block. The ball is a RigidBody2D with default properties and gravity. The red block is a kinematic body that moves vertically.

Here is the kinematic body:

extends KinematicBody2D

var speed=100

func _physics_process(delta):
    move_and_slide(Vector2(0,-speed))

If I set slow speed low, like below 50, it doesn't penetrate. How can I remove the penetration at higher speeds?

asked Jun 19 in Engine by Bruce (16 points)

1 Answer

0 votes

The problem is likely created by the collision box you're using. Make sure both of them work fine. Also, try to avoid circles with other polygons for a while. They don't play nice.

answered Jun 19 by Drawsi (34 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.