My Godot version is 4.2.1
How do I make a character die when falling into the void?
My Godot version is 4.2.1
How do I make a character die when falling into the void?
Add an Area to the void and kill player when it enters the area.
is there a way to kill the character using only code?
Every frame check the vertical component of the player position (depending on 2D or 3D it’s different). If this component becomes too big, that means that the player fell too far down. Exact numbers depend on position and size of your levels.
It depends on what you mean by kill. You can use “queue_free()” to delete the character, but that might cause issues depending on your setup. You can also use “hide()” to just hide the character.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.