![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | Z77 |
I just started using this engine, and was in the middle of making a player movement script.
var velocity = Vector2(0,0)
const SPEED = 4
const GRAVITY = 0.5
const JUMP = -10
func _physics_process(delta):
if Input.is_action_pressed("right"):
velocity.x = SPEED
if Input.is_action_pressed("left"):
velocity.x = -SPEED
velocity.y = velocity.y + GRAVITY
if Input.is_action_pressed("up"):
velocity.y = JUMP
velocity = move_and_collide(velocity)
velocity.x = lerp(velocity.x,0,0.2)
I was testing out this portion, and kept getting prompt with the error “The argument “delta” is never used in the function _physics_process.” I tried using " _delta" instead, but my game still wont run.
That is a warning, not an error message. It has no impact on your game running. If your game isn’t running, that’s an entirely different problem.
kidscancode | 2021-05-03 22:23
In the project settings, have you changed the settings to treat warnings as errors? That could be the problem.
magicalogic | 2021-05-04 11:50