I have 3 collision layers:
- Player
- Coin
- Enemy
My nodes are colliding well, but when my Player collides with the Coin or the Enemy i can't differentiate between the two of them. Normally i would do this by setting collision groups but if the layers are already set it may be easier to check the layer.
Posible solution using groups
func _on_Player_area_entered(area):
if area.is_in_group('enemies'):
pass
if area.is_in_group('coins'):
pass
How can i get the Coin and the Enemy collision layers programmatically when they collide with Player?