Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | checharor |
I’ve my charecter in the ground and everything works perfect, i’m wondering how can i make it “Ignore Gravity” so he can fly when i press a key, here’s my code:
extends KinematicBody2D
const SPEED = 170
const GRAVITY = 10
const JUMP = -400
const FLOOR = Vector2(0, -1)
var velocity = Vector2()
var on_floor = false
func _physics_process(delta):
velocity.y += GRAVITY
Thnx a lot