Hi i’m new to Godot and i am trying to create this function:
func _physics_process(delta):
But it doesn’t work Godot just keeps saying: Expected indented block after function declaration. Can Anyone help
Hi i’m new to Godot and i am trying to create this function:
func _physics_process(delta):
But it doesn’t work Godot just keeps saying: Expected indented block after function declaration. Can Anyone help
If you write only that this is the problem, you need to put something inside the function scope. If you’re having trouble with indetation i recommend you study more the basics of programming before do any project.
what is the function scope?
If your function only contains the definition, you’ll need to use the “pass” keyword as a placeholder until you fill in the rest of the code.
It would look something like this:
func _physics_process(delta):
pass
GDScript is similar to Python in that it relies on indentation. So if there’s no code there to indent, you’ll need this special keyword to act as a placeholder.
Thank you so much
func _physics_process(delta):
# Everything inside this indetation is inside the function scope
velocity.x = 100
move_and_slide()
thank you
As i said before, i recommend you study more the basics of programming before do anything, because indetation and func/variable scope is the very very basic of programming.
i will thank you