![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | Alex1900 |
Hello! I need help!
Just try to going out of a heavy Unity, and replicate my simple game in Godot… So, trying to understand collisions.
What I have:
Hero (CharactedBody2D) with Sprite2D and CollisionShape2D
Enemy (RigidBody2D) with MeshInstance and CollisionShape2D
Bullet (Area2D) with Sprite2D and CollisionShape2D
All shapes are configured normally. So I need to take a collision from Hero and Bullet (depends what, to do diff things at Enemy side).
So, I linked Enemy:
func _on_body_entered(body):
print_debug(“FIRE!”)
So, from logical point of view it should works – Enemy should take collisions and depends on Body, I will use different logic…
But… This message ‘FIRE!’ happens only when Enemy laying (collide with) to ground!! Bullets, Hero, did not raise any collisions!
In Unity I just put OnCollisionEnter2D to Enemy script and get an all collisions with all needed objects, separate them by collision object name, tag etc… How to deal here?..
Thanks in advance!