小编Lin*_*Fun的帖子

Godot引擎与KinematicBody的碰撞不起作用

我在摆弄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/CollisionShape2dset_pos

collision gdscript godot

5
推荐指数
1
解决办法
2118
查看次数

标签 统计

collision ×1

gdscript ×1

godot ×1