0 votes

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 physicsprocess." I tried using " _delta" instead, but my game still wont run.

Godot version v3.3.stable.offical
in Engine by (12 points)

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.

In the project settings, have you changed the settings to treat warnings as errors? That could be the problem.

2 Answers

0 votes

Did you try factoring in delta here?

 move_and_collide(velocity * delta)
by (2,080 points)
0 votes
  1. This is a warning, not an error. To solve it, just put an underscore in front of delta

  2. You should be using delta. Use move_and_slide() instead of move_and_collide(). it is better for many reasons, especially for beginners, and it also incorporates delta automatically.

by (577 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 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 webmaster@godotengine.org with your username.