0 votes

Hi, I make something when the player got damage I disabled her collision shape 2D but it also desactivate is collision whit the tilemap.how I can code something to tell to the player
to keep collision whit the tilemap and disabled collision whit player?
Thank for helping me!!!(人 •͈ᴗ•͈)

Sorry if it is not clear write it really fast

in Engine by (77 points)

2 Answers

0 votes

You need to use the Collision Layers and Masks to do exactly what you need.

by (61 points)
0 votes

Make a boolean variable and set to true if you want to make invincible your character.
You need to checking the player what is colliding. And the collider is enemycollider and boolean is true then no make damaging.

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