![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | NoClip |
well, i dont know why but move_and_slide are wrong, anyone can help me?
code:
extends Node2D
const UP = Vector2(0,-1)
const BOOST = 200
const GRAVITY = 10
var motion = Vector2()
func _ready():
pass # Replace with function body.
func _physics_process(delta):
motion.y += GRAVITY
if Input.is_action_just_pressed("ui_accept"):
motion.y =-BOOST
motion = move_and_slide(motion,UP)