Jump script is not working please help
script: extends KinematicBody2D
export var velocity = Vector2.ZERO
export var speed = Vector2(300.0,300.0)
export var gravity = 300.0
var Accel = 10
const UP = Vector2(0, -100)
const JUMP = -10
func _process(delta: float) -> void:
if Input.is_action_pressed("ui_right"):
velocity.x += gravity * delta
velocity.x = max(velocity.x , speed.x)
if Input.is_action_just_released("ui_right"):
velocity.x = 0
if Input.is_action_pressed("ui_left"):
velocity.x -= gravity * delta
if Input.is_action_just_released("ui_left"):
velocity.x = 0
func physicsprocess(delta: float) -> void:
velocity.y = gravity
if Input.isactionjustpressed("uiup"):
velocity.y = -25
velocity = move_and_slide(velocity,UP)