The Godot Q&A is currently undergoing maintenance!

Your ability to ask and answer questions is temporarily disabled. You can browse existing threads in read-only mode.

We are working on bringing this community platform back to its full functionality, stay tuned for updates. | Twitter

+1 vote

I have a kinematic 2d which moves with MoveAndSlide(velocity, Vector.Up) in _process
Lag doesn't change horizontal moving speed and it moves always with the same speed but jump height is always changing with fps
How to solve that?
Also there isn't such a problem while i use the code with _physicsProcces .but i can't use that because it causes lag when a there is a lot of nodes with that script in tree

void Jump()
void Move()
velocity.y+= Gravity;
public override void _Process(float delta)
velocity=MoveAndSlide (velocity, Vector.Up)
Godot version Godot 3.5.1
in Engine by (15 points)

1 Answer

0 votes

I too am a noob so I may be getting this wrong, please correct me if so:

  • delta is the time since the last frame

  • this means your movement speed will change based on FPS

  • you need to multiply the variable you are calling in process() by delta to make sure it is occurring per second, and not per frame. velocity = delta * MoveAndSlide(..)

by (35 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 Frequently asked questions and 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 [email protected] with your username.