How can I make Area2D detect collisions reliably?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Azdrawee

I’m making a simple platformer game in which the player can shoot bullets at enemies. The bullet is an Area2D that uses the translate function to move and the enemy is a KinematicBody2D with an Area2D that I’m using to detect this collision. My collision code in the enemy and bullet are as simple as they can possibly be:

Bullet:

func _on_Bullet_body_entered(body):
	queue_free()

Enemy:

func _on_DeathArea_area_entered(area):
	lives -= 1

Yet the collision does sometimes not get detected, which leads to very frustrating gameplay - sometimes enemies with three lives require 7 shots to die. What is causing this to happen and how can I fix it? Thank you for your help!

:bust_in_silhouette: Reply From: exuin

It’s possible that the bullet is moving so fast that it skips over the Area2D. In this case, you should try increasing FPS or lowering the bullet speed. Or maybe the issue something else?