|Topic was automatically imported from the old Question2Answer platform.
Hello everyone, im new to programing and im struggling with my game.
I want to double the speed of an enemy, when the player is incide an area.
This is what I have.
func _on_Fov_body_entered(body: Node) -> void: velocity.x *= 2
If I do this it will keep multiplying as long as the player is incide the area.
How can i double the speed once but when i leave the area the speed(velocity.x) is back to normal.