in script it say me "unindent does not match any outer indentation level" but i can't find a mistake please help

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By god121

extends KinematicBody2D

const GRAVITY= 10
const SPEED = 30
const FLOOR = Vector2(0,-1)

var velocity = Vector2()

func _ready():

func _physics_process(delta):

 velocity.x = SPEED


 velocity.y = GRAVITY
:bust_in_silhouette: Reply From: jgodfrey

It’s impossible to assist with “indent-level” issues unless you post the offending code inside the forum’s code tags. Above, there are 3 lines that appear to be in code tags (and they show inconsistent alignment).

To do that, simply paste the code you want into your post, select it all, and then click the Code Sample button in the toolbar immediately above the post editor (the button with “{ }” icon).

A few guesses, without seeing the proper code…

  • Make sure you don’t mix using tab and space for indents. Pick one and stick to it.
  • Ensure that everything that should be at the same indent level really is (exactly).

If you can’t find it, repost your code (as instructed above) for more assistance.

Here’s an incorrectly indented sample that will cause the error you mention:

func _on_Button_pressed():
    if true:
        print ("true")
     print("bad indent level")

Notice that last print line doesn’t align with other indent levels…