0 votes

I have some inherited scenes that I have a button for a script to return to a mainMenu.

I know with C# you have to rebuild with export variables. But i can't seem to build the project, the errors I get are highlighted below. Anything I missed out or overlooked? Thank you for your help! :)

My code for the simple script

using Godot;
using System;

public class MenuButton : Button
{
    [Export]
    public string scene_to_load;

}

My Output Build Errors:

 Failed to get modified time for: C:/Users/Godot/Scenes/Main%20Menu/Buttons/MenuButton.cs
 modules/mono/utils/string_utils.cpp:168 - Condition ' err != OK ' is true. returned: err
 modules/mono/editor/script_class_parser.cpp:650 - Method/Function Failed, returning: ferr
 modules/mono/editor/csharp_project.cpp:183 - Parse error: 
 Failed to determine namespace and class for script: res://Scenes/Main%20Menu/Buttons/MenuButton.cs
 modules/mono/editor/mono_bottom_panel.cpp:168 - Condition ' metadata_err != OK ' is true.
asked May 18 in Engine by AlMoeSharpton86 (40 points)

1 Answer

0 votes

Currently in 3.1, if the folder paths have a space in them that lead to a script you will get these errors. The best way to handle it is to just eliminate the space, go to the csproj and open it with a text editor and delete the previous scripts that were in the folder. Then go back to godot and build the project under mono. This should fix the problem.

answered Aug 3 by Holo74 (14 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.