GODOT - 3d Gravity

Sait Maraşlıoğlu
1 min readMay 2, 2020

--

Example 1 :

var jump_force : float = 10.0
var gravity : float = 15.0
var velocity = Vector3()
func _physics_process (delta):
# Apply gravity every frame if possible
velocity.y -= gravity * delta
# Jumping
if Input.is_action_pressed("jump") and is_on_floor():
velocity.y = jump_force
velocity = move_and_slide(velocity, Vector3.UP)

--

--

Sait Maraşlıoğlu
Sait Maraşlıoğlu

Written by Sait Maraşlıoğlu

Erp Consultant, wanna be pythonistas

No responses yet