我在摆弄Godot引擎,并尝试了一些小游戏。
但是我似乎无法获得有关碰撞的信息。
if is_colliding():
print ("Collision with " + get_collider())
get_node("Sprite").set_texture(walk_cycle_right_1)
move_state_right = 1
set_pos(Vector2(get_pos().x -10, get_pos().y))
Run Code Online (Sandbox Code Playgroud)
它总是打印false。我正在用命令移动我的角色(KinematicBody2d-> Sprite/CollisionShape2d)set_pos。