0 votes

My problem is that I have variables that are less than 0, so when passing them through a Vector2 in move_and_slide() of a KinematicBody2D, it ends up going very slow than it should be because the Vector multiplies by delta.

The solution is clearly change my variables by others that the moveandslide function can understand. But the problem is that I am trying to replicate the physics of an old game, and I am not sure whats are the variations of those variables for a modern engine. I only know these variables.

So, I had a solution: multiply the Vector2 velocity by (1/delta) for obtain a big numeric variable, then this vector is used by moveandslide and counter the effect delta of this function. But this is a problem because delta time is necesarily for make consistent the game despite low or high fps, isn't it?

My other solution is: multiply all variables by (1/delta) and save this in others, so I can use this without a problem. But I have the same question. Does this affect the game at all?

Maybe I should use move_and_collide without delta... but this is the same problem.
My variables are like this:

var acceleration = 0.046875
var gravity = 0.21875
var deceleration = 0.5

Godot version 3.2.3
in Engine by (12 points)

Please log in or register to answer this question.

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.