![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | fish34 |
im making a geometry dash game and i want the player to die when i run into a block and stop. i have a set velocity for gravity and for moving left.
func _physics_process(delta):
velocity.x = 255 #moves player forward
velocity.y += GRAVITY
if velocity.x == 0:
die()
but when i printed out my velocity it showed 255 and when i got stopped by the block it kept saying 255 even though i wasnt moving. is there some kind of function or way that can detect if my character stops moving?