Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var jump_buffer_counter = 0
- var cayote_counter = 0
- @export var jump_buffer_time = 15
- @export var cayote_time = 15
- func _physics_process(delta):
- If is_on_floor():
- cayote_counter = cayote_time
- If ! is_on_floor():
- If cayote_counter > 0
- cayote_counter -= 1
- Velocity.y += gravity*delta
- If Input. is_action_pressed("jump"):
- jump_buffer_counter = jump_buffer_time
- If jump_buffer_counter > 0:
- jump_buffer_coumter -= 1
- If jump_buffer_counter > 0 and cayote_counter > 0:
- velocity.y = jump_force
- jump_buffer_counter = 0
- cayote_counter = 0
Add Comment
Please, Sign In to add comment