0 votes

Hey I'm new to game development and coding and I've been following this tutorial on YouTube
https://www.youtube.com/watch?v=xFEKIWpd0sU&t=1s
and I have an error in my code but I cant figure out what the problem is
thanks in advance for the help

The code

extends KinematicBody2D

const UP = Vector2(0,-1)
const GRAVITY = 20
const MAXFALLSPEED = 200
const MAXSPEED = 80
const JUMPFORCE = 300

var motion = Vector2()

func _ready():
pass

func physicsprocess(_delta):

motion.y += GRAVITY
if motion.y > MAXFALLSPEED:
    motion.y = MAXFALLSPEED

if input.is_action_pressed("right"):      **Error here**
    motion.x = MAXSPEED
elif input.is_action_pressed("left"):
    motion.x = -MAXSPEED
else:
    motion.x = 0

if is_on_floor():
    if input.is_action_just_pressed("space"):
        motion.y = -JUMPFORCE

motion = move_and_slide(motion,UP)
in Engine by (12 points)

1 Answer

0 votes

It's Input with a capital "I".

by (21,716 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 Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.