【发布时间】:2021-03-24 05:22:29
【问题描述】:
我之前问过这个问题并得到了答案,但那个答案没有用,那个人也没有回应,所以这是我最后的努力,运动体没有移动是的,我在项目设置中添加了控件,是的,没有错误。我不知道该怎么办。 `
Extends KinematicBody2D
var movespeed = 500
func _ready():
pass # Replace with function body.
func _physics_process(delta):
var motion = Vector2()
if Input.is_action_pressed("up"):
motion.y -= 1
if Input.is_action_pressed("down"):
motion.y += 1
if Input.is_action_pressed("left"):
motion.x += 1
if Input.is_action_pressed("right"):
motion.x -= 1
motion = motion.normalized()
``
【问题讨论】:
-
你试过move and slide吗?它会缩小问题的范围。
标签: game-engine godot