Attention | Topic was automatically imported from the old Question2Answer platform. | |
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!