Character doesn't jump as high when moving?

Godot Version

Godot V4.3

Question

Is it they way I have my movement set up or am I missing something?

const speed = 300
const max_speed = 400
const jump = -600
const friction = 400
const gravity = 25
var input = Vector2()
var health = 100
var anim_locked := false

func _ready():
	print("ready")
	pass

func _physics_process(delta):
	input = get_input()
	position += velocity * delta
	velocity.y += gravity 
	
	
	if input.x == 0.0:
		if velocity.x > (friction * delta):
			velocity = velocity.normalized() * (friction * delta)
			#print("got input")
		else:
			velocity.x = 0.0
	else:
		velocity += (input * speed * delta)
		velocity = velocity.limit_length(max_speed)
	if Input.is_action_pressed("slash"):
		$animation.play("attack")
		animation_locked("attack", true)
		velocity.x = 0
		
	elif  Input.is_action_pressed("jump") && is_on_floor():
		velocity.y = jump
	elif velocity.y < 0:
		animation_locked("jump", true)
		$animation.play("jump")
			
	elif Input.is_action_pressed("left"):
		$animation.play("walking")
		$animation.flip_h = true
		#print("flipped")
	elif Input.is_action_pressed("right"):
		$animation.play("walking")
		$animation.flip_h = false
		#print("walking")
	else:
		if is_on_floor():
			$animation.play("still")
	if Input.is_action_pressed("duck") and velocity.x == 0:
		$animation.play("duck")
		#print("ducking")
	elif Input.is_action_pressed("duck") and velocity.length() > 0:
		$animation.play("slide")
		velocity *= .90
		#print("sliding")
		if velocity.length() < 75:
			velocity.x = 0
			$animation.play("duck")
			
	move_and_slide()

func get_input():
	input.x = int(Input.is_action_pressed("right")) - int(Input.is_action_pressed("left"))
	input.y = int(Input.is_action_pressed("jump"))
	return input.normalized()

Because as you did in this question you’re changing the entire vector instead modify just the x component. You need to separate how you treat the x speed (moviment) from the y speed (jump/gravity)

okay so im getting an error that says Invalid operands 'float' and 'Vector2' in operator '+'.… Im pretty sure it’s because my input is an integer and my velocity.x is a float? how can I change this to make input a float or would it be easier to just make vector2/velocity an integer

func get_input():
	input.x = int(Input.is_action_pressed("right")) - int(Input.is_action_pressed("left"))
	input.y = int(Input.is_action_pressed("jump"))
	return input.normalized()

No, your input is not an integer, the variable input in your code is a Vector2, i recommend you take a look in how is a basic code for a platform character:

Yea I figured out it was this exact line holding my jump back.

velocity = velocity.limit_length(max_speed)

Thank you! Can’t believe that didnt make sense to me before.