There doesn’t seen to be any difference in the jump height and the jump Pad height, not sure what’s going on
Player script
extends CharacterBody2D
class_name Player
@export var gravity = 400
@export var jump_force = 200
@export var speed = 125
@onready var animated_sprite = $AnimatedSprite2D
#func _process(delta):
#if Input.is_action_just_pressed(“move_right”):
#animated_sprite.play(“run”)
func _physics_process(delta):
if is_on_floor()==false:
velocity.y += gravity * delta
if velocity.y > 500:
velocity.y = 500
if Input.is_action_just_pressed("jump"): #&& is_on_floor():
#velocity.y = -jump_force
jump(jump_force)
var direction = Input.get_axis("move_left", "move_right")
if direction != 0:
animated_sprite.flip_h = (direction == -1)
velocity.x = direction * speed
move_and_slide()
update_animations(direction)
func jump(force):
velocity.y = -jump_force
func update_animations(direction):
if is_on_floor():
if direction == 0:
animated_sprite.play(“idle”)
else:
animated_sprite.play(“run”)
else:
if velocity.y < 0:
animated_sprite.play(“jump”)
else:
if velocity.y > 0:
animated_sprite.play(“fall”)
Jump pad script
extends Area2D
@export var jump_force = 300
@onready var animated_sprite = $AnimatedSprite2D
func _on_body_entered(body):
if body is Player:
animated_sprite.play(“jump”)
body.jump(jump_force)