error:non existent function is_action_pressed in base nil

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

if i start the scene , it shows this error:

error:non existent function is_action_pressed in base nil

extends KinematicBody

func _ready():
pass

#stats
var curHP : int = 10
var maxHP : int = 10
var ammo : int = 15
var score : int = 0

#physics
var movespeed : float = 5.0
var jumpforce : float = 5.0
var gravity : float = 12.0

#camera
var minLookAngle : float = -90.0
var maxLookAngle : float = 90.0
var lookSensitivity : float = 10.0

#vectors
var vel : Vector3 = Vector3()
var mouseDelta : Vector2 = Vector2()

onready var Camera : Camera = get_node(“Camera”)
onready var muzzle : Spatial = get_node(“Camera/muzzle”)

#move
func _physics_process(delta):

vel.x = 0
vel.z = 0

var input = Vector2()   
#move inputs
if input.is_action_pressed("move_forward"):    <------ error
	input.y -= 1
if input.is_action_pressed("move_backward"):
	input.y += 1
if input.is_action_pressed("move_left"):
	input.x -= 1
if input.is_action_pressed("move_right"):
	input.x += 1

input = input.normalized()

var forward = global_transform.basis.z
var right = global_transform.basis.x

var relativDir = (forward * input.y + right * input.x)


vel.x = relativDir * movespeed
vel.z = relativDir * movespeed

vel.y -= gravity * delta

vel = move_and_slide(vel, Vector3.UP)

if input.is_action_pressed("jump") and is_on_floor():
	vel.y = jumpforce
	
	
:bust_in_silhouette: Reply From: Ertain

Common mistake. In the code above, input.is_action_pressed("move_forward") should be Input.is_action_pressed("move_forward"). I would suggest changing the variable for the Vector2 to a different name (maybe player_input?).

:bust_in_silhouette: Reply From: theMX89

thanks for the tipp, so shoud i write now a new variable like this:
var player_input = Vector2 ?

(im pretty new to godot)

:bust_in_silhouette: Reply From: theMX89

thanks you all, now it works