Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
"this" is clear to no one. Format your code.
Source Link
DMGregory
  • 141k
  • 23
  • 258
  • 401

How do i fix this "ui is not declared in current scope" error

I just started development for a game iI have to design for school and when. When using gd in the script to make the character move right iI get an error and i need help here is the script

extends KinematicBody2D

var motion = Vector2()

func _physics_process(delta):

extends KinematicBody2D 

var motion = Vector2()

func _physics_process(delta):
    
    if input.is_action_pressed(ui.right):
        motion.x = 100
    
    move_and_slide(motion)

thisThis is the line that is giving me problems

if input.is_action_pressed(ui.right):

if input.is_action_pressed(ui.right):

and it keeps saying that ui is not declared in the current scope

please help

How do i fix this

I just started development for a game i have to design for school and when using gd in the script to make the character move right i get an error and i need help here is the script

extends KinematicBody2D

var motion = Vector2()

func _physics_process(delta):

if input.is_action_pressed(ui.right):
    motion.x = 100

move_and_slide(motion)

this is the line that is giving me problems

if input.is_action_pressed(ui.right):

and it keeps saying that ui is not declared in the current scope

please help

"ui is not declared in current scope" error

I just started development for a game I have to design for school. When using gd in the script to make the character move right I get an error:

extends KinematicBody2D 

var motion = Vector2()

func _physics_process(delta):
    
    if input.is_action_pressed(ui.right):
        motion.x = 100
    
    move_and_slide(motion)

This is the line that is giving me problems

if input.is_action_pressed(ui.right):

and it keeps saying that ui is not declared in the current scope

Source Link

How do i fix this

I just started development for a game i have to design for school and when using gd in the script to make the character move right i get an error and i need help here is the script

extends KinematicBody2D

var motion = Vector2()

func _physics_process(delta):

if input.is_action_pressed(ui.right):
    motion.x = 100

move_and_slide(motion)

this is the line that is giving me problems

if input.is_action_pressed(ui.right):

and it keeps saying that ui is not declared in the current scope

please help