Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | JeanKouss |
Here is a link to an video record of the problem (if the gif don’t load)
As the title says, when moving my player towards a direction and then another character hit it by behind, the engine seems not detecting that collision.
I move the player with : move_and_slide
and both my player and the other character are KinematicBoby
type.
Here is the code for detecting the collision for my player :
# Some code to handle inputs
velocity = move_and_slide(velocity)
for index in get_slide_count() :
collide_data = get_slide_collision(index)
print(self.name + " collided with " + collide_data.collider.name)
print(get_slide_count())
The problem is the same when using move_and_collide
:
Here is its code :
collide_data = move_and_collide(computedVelocity * delta)
if collide_data :
print(self.name + " collided with " + collide_data.collider.name)