0 votes

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 physicsprocess(delta):
if Input.iskeypressed(KEYW):
move
andcollide(Vector2(0,-speed)):
else Input.is
keypressed(KEYS):
moveandcollide(Vector2(0,speed)):

asked Jan 16 in Engine by ZombieGame007 (25 points)

1 Answer

0 votes

Your code came through a bit funky, but I'm taking a guess and thinking that you need to remove the semicolon at the end of these 2 lines:

moveandcollide(Vector2(0,-speed)):
...
moveandcollide(Vector2(0,speed)):
answered Jan 16 by eod (92 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.