0 votes

as the title says, while holding the directional button it will only move one, and not continually. here is my code and under the debugger says something but i cant seem to find the answer or figure out what they mean. i am new to coding so i would appreciate anything that can help me out, or direct me to a source that might be helpful in the future.

extends KinematicBody2D

var velocity = Vector2()

func physicsprocess(delta):
velocity.y += 0
if Input.isactionjustpressed("uiright"):
velocity.x = 100
elif Input.isactionjustpressed("uileft"):
velocity.x = -100
velocity.x = 0



W 0:00:10:0471 The function 'moveandslide()' returns a value, but this value is never used.

W 0:00:10:0471 The argument 'delta' is never used in the function 'setphysics_process'.

asked Aug 25, 2019 in Engine by deezy (39 points)
recategorized Aug 25, 2019 by deezy

1 Answer

0 votes
Best answer

The problem lies in the is_action_just_pressed cause this will only return true the first frame, the key got pressed and false afterward. What you should use instead is the is_action_pressed function.

Also see:



answered Aug 25, 2019 by Nophlock (181 points)
selected Aug 26, 2019 by deezy

it works :D thanks :D

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.