0 votes

Hello. I was working on a platformer and I wanted to a spike that kills the player on contact. I added it to the tileset, but I can't seem to find a way to make the player know it just touched a spike. Is there a way to solve this? Thanks in advance.

Godot version 3.2.3
in Engine by (24 points)

2 Answers

0 votes

You need to get the name of the tile your player is colliding on when he is on the floor

Then if the tile is a spike you apply a damage function to the player and maybe a knock back function

by (179 points)

how do i do that

0 votes

you can try to add an area to your tile and then the signal onareaentered_body

by (106 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.