Particle emission by object collision does not work when colliding with RigidBody2D or CharacterBody2D

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

I have a problem.
I wanted to add particles when Projectile is collides objects.
And it works. But only with TileMap. It doesn’t work when its colliding RigidBody2D or CharacterBody2D. It doesn’t work the same if i immediately specify them instead of TileMap.
Destroying object with queue_free() still working for them all, but not particles.

extends RigidBody2D

func _on_bllet_hitbox_body_entered(body):
var particles = preload(“res://projectilecollision.tscn”)
var fire = particles.instantiate()
body.get_parent().add_child(fire)
fire.get_global_position()
fire.global_transform.origin = body.to_local(get_global_transform().origin)

if body is TileMap:
	queue_free()
elif body is RigidBody2D or body is CharacterBody2D:
	queue_free()

bllet_hitbox - area2d of projectile

If the signal handler isn’t called, then it isn’t configured to trigger for bodies. There’s a setting to collide with areas or bodies; enable it for bodies. If it isn’t that, perhaps the bodies aren’t configured to interact on the same layer? Could be a number of things but if it isn’t_getting_ to the signal handler, you need to verify how the bodies are configured in the editor

spaceyjase | 2023-05-20 19:37