0 votes

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 :)

in Engine by (49 points)

you can create connection like:

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

func hey_u_collider:
    print("intersect")

1 Answer

0 votes
Best answer

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!

by (49 points)
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.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.