Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | randomguy |
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.
Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | randomguy |
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.
Reply From: | VitusVeit |
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
break
position.x -= 100 * delta
And on collision with the Area2D set falling to true
Thanks, you helped me again! Took me some time to get everything to work properly, though
randomguy | 2022-04-25 14:43
Working with collision and physics is always hard, but don’t worry, with time it will be a easy task!
VitusVeit | 2022-04-29 15:18