Best way to check for intersection without colliding

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

EDIT: Literally 1 minute after asking this question I saw the Area node has an area_entered signal, I’m pretty sure that’s exactly what I need!

I have a KinematicBody player, who can slide along the walls which are StaticBodys using move_and_slide. I also want the player to set off mines when they touch a mine.

I am currently doing this by checking each time the player collides which group the collider was, and if it was in the Mines group, then I call the collider.explode() method which removes the mine. However, I’m pretty sure this group checking can only happen after the player has collided, which means that when the player collides with a mine, they are slightly pushed by it before the mine is removed.

Is there another way of checking if the player is intersecting a collision shape without having the player slide on it? Thanks :slight_smile:

you can create connection like:

func _ready()
    get_node("thatnamedkinematicbody).connect("body_entered", self, "hey_u_collider")

func hey_u_collider:
    print("intersect")

Okan Ozdemir | 2020-05-04 00:35

:bust_in_silhouette: Reply From: Hasnep

Copying my edit here in case this is helpful for anyone else:

Literally 1 minute after asking this question I saw the Area node has an area_entered signal, I’m pretty sure that’s exactly what I need!