# Coyote jump is not working

**URL:** <https://forum.godotengine.org/t/coyote-jump-is-not-working/48960>\
**Category:** Programming\
**Tags:** gdscript, godot-4, 2d\
**Created:** [February 22, 2024, 6:12pm UTC](https://forum.godotengine.org/t/coyote-jump-is-not-working/48960 "2024-02-22T18:12:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![caveman\_grug](https://forum.godotengine.org/letter_avatar_proxy/v4/letter/c/bbce88/32.png) [@caveman\_grug](https://forum.godotengine.org/u/caveman_grug)\
**Post date:** [February 22, 2024, 6:12pm UTC](https://forum.godotengine.org/t/coyote-jump-is-not-working/48960/1 "2024-02-22T18:12:35Z")

</div>

### Godot Version

godot v4.2.1

### Question

I tried to add coyote jump to buılt in character controller code but it just lets you to jump infinitely

here is the code:

extends CharacterBody2D  
var SPEED = 400.0  
const JUMP\_VELOCITY = -600.0

# Get the gravity from the project settings to be synced with RigidBody nodes.

var gravity = ProjectSettings.get\_setting(“physics/2d/default\_gravity”)

@onready var cyt = $cyt

func \_physics\_process(delta):  
# Add the gravity.  
var was\_on\_floor= is\_on\_floor()  
if not is\_on\_floor():  
velocity.y += gravity \* delta

```
# Handle jump.
if Input.is_action_just_pressed("jump"):
	if is_on_floor() or cyt.time_left>0.0:
		velocity.y = JUMP_VELOCITY
print(cyt.time_left)	

# Get the input direction and handle the movement/deceleration.
# As good practice, you should replace UI actions with custom gameplay actions.
var direction = Input.get_axis("left", "right")
if direction:
	velocity.x = direction * SPEED
else:
	velocity.x = move_toward(velocity.x, 0, SPEED)

move_and_slide()
var jll= was_on_floor and not is_on_floor() and velocity.y>=0
if jll:
	cyt.start()
print(was_on_floor==is_on_floor())

```
