What does "Standalone lambdas cannot be accessed. Consider assigning it to a variable"

Godot Version

Godot version 4.2.1

Question

I’m extremely new to godot, and I’m trying to make 3d player movement using a tutorial on docs.godotengine.org, and when I use a piece of code, I get the error message seen above. Can anyone help me know what it means

Line of code that makes the message display:

func _physics_process (_delta):

The page I’m using as help:

Will give more information if asked

Not sure if you found a solution yet plus you didn’t give much info but its likely a problem with indentation.
If you copy and pasted it directly from the docs it might have pasted into the engine without proper spacing. Try retyping instead (if you did copy and paste) and see if the error still persists.
Otherwise maybe remove the underscore by delta (instead of _delta use delta).

1 Like

retyped it and removed the underscore, but the error still persisted. Here’s the lines of code that are apart of the line that’s in the question (if that’s the correct term)

	if direction != Vector3.ZERO:
		target_velocity.x = direction.x * speed
		target_velocity.z = direction.z * speed
	if not is_on_floor():
		target_velocity.y = target_velocity.y - (fall_acceleration * delta)
	velocity = target_velocity
	move_and_slide()

Can you show the entire script?