godotengine / godotengine/godot-visual-script
can_instantiate() error while following first 3D game tutorial
- Dominant language
- C++
- Stars
- 131
- Forks
- 25
- PR merge metrics
- No merged PRs in 30d
Description
### Godot version
4.1.2 Mono
### System information
Windows 11 Home 22H1
### Issue description
I'm absolutely new to Godot and just followed the 3D game tutorial on Godot Docs, but cannot run the player.cs script due to the can_instantiate() giving an error saying the CharacterBody3D class can't be found.
Error Message:
```
E 0:00:00:0730 can_instantiate: Cannot instance script because the associated class could not be found. Script: 'res://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).
Method/function failed. Returning: false
modules/mono/csharp_script.cpp:2388 @ can_instantiate()
```
The .csproj contents were:
```html
net6.0
true
$(MSBuildProjectDirectory)
```
While the .sln content
```
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.7.34202.233
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Squash the Creeps (3D)", "Squash the Creeps (3D).csproj", "{2C874C92-5724-442C-BB10-7A09E7CD17E3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
ExportDebug|Any CPU = ExportDebug|Any CPU
ExportRelease|Any CPU = ExportRelease|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{2C874C92-5724-442C-BB10-7A09E7CD17E3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2C874C92-5724-442C-BB10-7A09E7CD17E3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2C874C92-5724-442C-BB10-7A09E7CD17E3}.ExportDebug|Any CPU.ActiveCfg = ExportDebug|Any CPU
{2C874C92-5724-442C-BB10-7A09E7CD17E3}.ExportDebug|Any CPU.Build.0 = ExportDebug|Any CPU
{2C874C92-5724-442C-BB10-7A09E7CD17E3}.ExportRelease|Any CPU.ActiveCfg = ExportRelease|Any CPU
{2C874C92-5724-442C-BB10-7A09E7CD17E3}.ExportRelease|Any CPU.Build.0 = ExportRelease|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {CD9C353F-1E60-4943-B756-5453F1B32648}
EndGlobalSection
EndGlobal
```
Yes, I have tried checked several other solutions but all did not fix my problems.
The ones I found were:
https://github.com/godotengine/godot/issues/73932
https://github.com/godotengine/godot/issues/71735
https://github.com/godotengine/godot/issues/73932
https://github.com/godotengine/godot/issues/75352
### Steps to reproduce
Following the Godot Docs 'Your First 3D game' tutorial up until 'Testing our player's movement' in step 3.
### Minimal reproduction project
_No response_
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.