Parser error: Expected indented block after if

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

extends KinematicBody2D
var speed = 1

Declare member variables here. Examples:

var a = 2

var b = “text”

Called when the node enters the scene tree for the first time.

func _physics_process(delta):
if Input.is_key_pressed(KEY_S):
move_and_collide(Vector2(0,speed))

:bust_in_silhouette: Reply From: johnygames

You need to indent the line after:

if Input.iskeypressed(KEYS):

This means that you should press tab before the nect line so that it becomes like this:

if Input.iskeypressed(KEYS):
    moveand_collide(Vector2(0,speed))

I had indented it and it still did so.

ZombieGame007 | 2020-01-15 23:43

Nvm, I got it! Thanks for the henp! Take my upvote

ZombieGame007 | 2020-01-15 23:45

1 Like