如何让相机跟随 Godot 中的玩家

How to make camera follow player in Godot

我在 Godot 中制作一个自上而下的游戏,当我将 Camera 2D 节点添加到我的播放器并将其设置为当前时,播放器卡在同一个地方并且无法再移动。我收到此错误消息

modules/gdscript/gdscript_tokenizer.cpp:1129 - Condition "tk_rb[ofs].type != TK_IDENTIFIER" is true. Returned: StringName()

有什么办法可以解决这个问题,还是我提供的信息不够?

确保 Camera 2D 节点是播放器的子节点并且相机没有脚本。只需选中属性中的当前复选框即可。