I'm trying to make my first game on godot, so I'm very inexperienced. It is a platformer. I'm following an old tutorial, where the set.trigger function was still present. Now, what should I use instead of it? The target is to make the player fall down when he touches the enemy. I created an area 2d with its collision shape, child of the player node, then in this 2d area I created the body entered signal connected with player. This would be the code:
func onArea2D2bodyentered(body):
if not alive: return
dying()
func dying():
if not alive: return
alive = false
velocity.y = -500
getnode("Area2D2/CollisionShape2D").settrigger(true)
Could anyone help me? Thanks a lot