+1 vote

I tried using Area2D on enemy to detect player entering it and then disabling player's CollisionShape2D but it doesn't seem to be working.

Godot version 3.4.4
in Engine by (30 points)

1 Answer

+1 vote
Best answer

You don't need to use physics, just create a bool falling, and in physics_process add:

if falling:
     if position.y >= OS.get_windows_size().y:
           falling = false
           #Respawn the player, or just remove a live
     position.x -= 100 * delta

And on collision with the Area2D set falling to true

by (99 points)
selected by

Thanks, you helped me again! Took me some time to get everything to work properly, though

Working with collision and physics is always hard, but don't worry, with time it will be a easy task!

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 Frequently asked questions and 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 [email protected] with your username.