0 votes

So i am new to this gdscript, and struggled to code a jump, this is my attempt

extends KinematicBody2D

var velocity := Vector2.ZERO
export var speed := 400.0
export var gravity := 1.0
export var jumppower := 40.0

func _ready():
pass # Replace with function body.

func physicsprocess(delta):
velocity= velocity*speed

I want an ordinary jump, but instead the script makes it teleport upwards then fall ordinarily. Are there any tips for fixing this issue? Thanks in advance, and sorry if my code is quite a mess.

asked Jun 21 in Projects by FireFart (12 points)

1 Answer

+1 vote
answered Jun 21 by deaton64 (1,261 points)

That really helped, thanks for that. But i prefer reasons why my code dont work cuz i want to understand how it works. Still, thanks a lot for the help :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.