Answers for "jump in godot"

0

jump in godot

extends KinematicBody

var jumpForce : float = 10.0
var gravity : float = 15
var vel : Vector3 = Vector3()

func _physics_process(delta):
	vel.y -= gravity * delta
  
	if Input.is_action_pressed("ui_accept") and is_on_floor():
		vel.y = jumpForce
        
	vel = move_and_slide(vel, Vector3.UP)
Posted by: Guest on July-18-2021

Browse Popular Code Answers by Language