Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | lukas | |
Old Version | Published before Godot 3 was released. |
When I move KinematicBody2D
with move()
, Area2D
emits body_enter
signal only if the collision shapes of these bodies overlap at the end of the move. If the kinematic body passes through the area and finishes behind the area, the signal is not emitted.
Is that expected and wanted behaviour or is it a bug? I would expect that the signal is emitted every time the kinematic body passes through the area.
I’m not familiar with physics, but there is an option for physics at Project Settings > Physics > fixed fps
try to increase this fixed fps value, like 120.
volzhs | 2017-05-20 14:28
I think that it is not a physics problem because if I change Area2D
to StaticBody2D
and make the same move, the KinematicBody2D
stops as expected.
lukas | 2017-05-20 14:32
This isn’t a bug, but an unrealistic expectation of the Area2D. I believe your KinematicBody2D is moving pretty fast in relation to the size of your Area2D. The Area2D really should be something where a body enters it on frame X and will be there for several frames afterwards. I don’t know the internals of the Physics Engine, but the PhysicsBody2D’s are much more optimized to handle these types of collisions(short) you described. You most likely need to increase the size of your Area2D.
2D||!2D | 2017-05-21 14:00
I understand that. And this is also my amateurish explanation to it. But I definitively have no idea how the physics bodies and areas are implemented in Godot. That is why I asked. So probably it is an expected behaviour.
(From my naive point of view I was expecting that Area2D
is able to detect exactly the same collisions as other physic bodies.)
lukas | 2017-05-21 14:36