Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- func _on_detect_box_body_entered(body): # Used when enemy DetectBox is entered
- collisionX = body.position.x # Get player's position on collide
- if body is Player: # Make sure it's the player
- if collisionX > position.x: # This if statement is likely my source of error.
- directionX = 1
- scale.x = 1
- elif not directionX == -1:
- directionX = -1
- scale.x = -1
- $Label.text = (str(collisionX - position.x) + " | " + str(directionX) + " | " + str(scale.x)) # Label is for debugging
Advertisement
Add Comment
Please, Sign In to add comment