0 votes

Hello peoples,

I do not know what I'm doing wrong when checking collisions with kinematicbord2d!
The collision only works on the top of the enemy and not on the sides.
I put the CollisionShape 2D right and put this code at the enemy:

if (is_colliding()):

    var colliding = get_collider()

    if colliding.is_in_group("hero"):
        print("colliding")
        pass

But nothing works :/
When the enemy leans on the hero on the sides nothing happens, but when I jump and stay on top of the enemy, the prints happen.
Is this a bug? someone help me please?!

asked Jul 9, 2017 in Engine by ismaelgame7 (131 points)

The collision checking methods on KinematicBodys only operate on collisions that happen after a call to move. You need to post the rest of your enemy code because it's impossible to tell what you are doing wrong from just this snippet.

Also add some information on the scenes structure.

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.