Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

can_instantiate() error while following first 3D game tutorial #75

Open

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).
 <C++ Error> Method/function failed. Returning: false
 <C++ Source> modules/mono/csharp_script.cpp:2388 @ can_instantiate()

The .csproj contents were:

<Project Sdk="Godot.NET.Sdk/4.1.2">
 <PropertyGroup>
 <TargetFramework>net6.0</TargetFramework>
 <EnableDynamicLoading>true</EnableDynamicLoading>
 <GodotProjectDir>$(MSBuildProjectDirectory)</GodotProjectDir>
 </PropertyGroup>
 <ItemGroup>
 <PackageReference Include="Godot.SourceGenerators" Version="4.1.2" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
 <PackageReference Include="GodotSharp" Version="4.1.2" />
 </ItemGroup>
</Project>

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:
godotengine/godot#73932
godotengine/godot#71735
godotengine/godot#73932
godotengine/godot#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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /