I cannot seem to make my character jump for some reason. I followed the tutorial perfectly and he had it running.

Godot Version

Replace this line with your Godot version

Question

Ask your question here! Try to give as many details as possible.

If you share code, please wrap it inside three backticks or replace the code in the next block:

extends CharacterBody2D

class_name PlayerController

@export var speed = 10.0
@export var jump_power = 10.0

var speed_multiplier = 30.0
var jump_multiplier = -30.0
var direction = 0

var gravity = ProjectSettings.get_setting("physics/2d/default_gravity")

func _Input(event):
	
	if event.is_action_just_pressed("jump") and is_on_floor():
		velocity.y = jump_power * jump_multiplier
		
	if event.is.action_pressed("move down"):
		set_collision_mask_value(10, false)
	else:
		set_collision_layer_value(10, true)

func _physics_process(delta):
	# Add the gravity.
	if not is_on_floor():
		velocity += get_gravity() * delta

	direction = Input.get_axis("move left", "move right")
	if direction:velocity.x = direction * speed * speed_multiplier
	else:
		velocity.x = move_toward(velocity.x, 0, speed * speed_multiplier) 
	
	move_and_slide()

We’ll need some more information before anyone can solve this, just looking at your code it looks like this would work if the project was made to support it.

Please provide a link to the tutorial you’re following, and a screenshot of your scene tree.

Try to increase jump power. Could be that default gravity is lower now than it was, especially if the tutorial is old. Then the gravity will eat up the upwards velocity before calling move and slide.

Unless they changed the default, default_gravity should be fine.

image

Their code should make their upward velocity 29,400 px/s^2 for a frame, then it would reduce by 980 a second.

In that case my guess would be that the entry in the input map is “Jump” with capital j but as you say, best is to share some more info and not just copy paste in a script with no context

capital I input isn’t an override, it must be lower case _input