# I don't get why i have done exactly like the tutorial suggest and it works for guy making the tutorial but not me.

Attention Topic was automatically imported from the old Question2Answer platform.
``````func _physics_process(delta: float) -> void:
var is_jump_interuppting: = Input.is_action_just_released("Jump") and _velocity.y < 0.0
var direction: = get_direction()
_velocity = calculate_move_velocity(_velocity, direction, speed, is_jump_interuppting)
_velocity = move_and_slide(_velocity, FLOOR_NORMAL)

func get_direction() -> Vector2:
return Vector2(
Input.get_action_strength("Move_Right") - Input.get_action_strength("Move_Left"),
-1.0 if Input. is_action_just_pressed("Jump") and is_on_floor() else 1.0
)

func calculate_move_velocity(
linear_velocity: Vector2,
direction: Vector2,
speed: Vector2,
is_jump_interuppting: bool
) -> Vector2:
var out: = linear_velocity
out.x = speed.x * direction.x
out.y += gravity * get_physics_process_delta_time()
if direction.y == -1.0:
_velocity.y = speed.y * direction.y
if is_jump_interuppting:
out.y = 0.0
return out
``````

SQBX | 2023-01-03 15:45

In what way doesn’t it work?

SteveSmith | 2023-01-03 16:57

We need to know what problem you are trying to solve to debug your code. We can’t help you if all you provide is code . Also, you should format your code appropriately in the forum post

godot_dev_ | 2023-01-03 20:49

I’ve edited the OP to format the code for the forum. @CatMetalLord - please do that yourself in future posts.

jgodfrey | 2023-01-03 23:09

I recognize the code. This is from GDQuest tutorial.

LeslieS | 2023-01-04 05:53

The problem is the indent level of testing for `is_jump_interrupted`. Should be changed to:
``````if direction.y == -1.0: