GODOT.CODE.VSCODE Godot与vscode踩的坑

1.Godot用vscode出现服务器连接失败

 

    godot做游戏一直出现vscode没法连接到godot编辑器

    记住后面的端口号,在【编辑器】-> 【编辑器设置】 -> 【网络】 -> 【调试适配器】 里把端口改成对应端口就行了

 

2.C++错误,无法创建实例

E 0:00:02:0424 can_instantiate: Cannot instance script because the associated class could not be found. Script: 'res://Script/player.cs'. Make sure the script exists and contains a class definition with a name that matches the filename of the script exactly (it's case-sensitive).
<C++ 错误> Method/function failed. Returning: false
<C++ 源文件> modules/mono/csharp_script.cpp:2388 @ can_instantiate()

脚本命名没有按照标准命名,比如player.cs,实际上要命名为Player.cs,首字母需要大写

 

3.检查器界面没有脚本导出的属性

用习惯unity,发现godot一直不出现导出的属性,以为是bug,后来才知道需要先build一下,这点unity还是可以的,热加载做的比较好,不过习惯问题也能将就。

 

posted @ 2023-10-01 22:57  风之郁闷  阅读(326)  评论(0编辑  收藏  举报