0 votes

Hello,

I've just started on Godot and I'm trying to setup a simple basic project and use the export feature. However, I'm getting an error when running the executable file.

Error:
https://prnt.sc/krf2or

The way I compiled my Godot Mono was:

GIT BASH
*git clone https://github.com/godotengine/godot.git*

x64 Native Tools Command Prompt for VS 2017
scons p=windows tools=yes modulemonoenabled=yes monoglue=no -j4
cd bin
godot.windows.tools.64.mono.exe --generate-mono-glue ../modules/mono/glue
cd ..
scons p=windows tools=yes module
monoenabled=yes monoglue=yes vsproj=yes -j4

My project:
I've created a project, created two scenes. The main scene is the camera one where I've attached the following script to a Camera node:

using Godot;
using System;

public class camera_main : Camera
{
    // Declare member variables here. Examples:
    // private int a = 2;
    // private string b = "text";
    private Vector3 transform;
    private float verticalMovement = 5.0f;
    private float horizontalMovement = 5.0f;
    private sbyte nbrOfPressedKeys = 0;

    // Called when the node enters the scene tree for the first time.
    public override void _Ready() {
        this.transform = GetCameraTransform().origin;
    }

    // Called every frame. 'delta' is the elapsed time since the previous frame.
    public override void _Process(float delta) {
        nbrOfPressedKeys = 0;
        if (Input.IsKeyPressed((int)KeyList.S)) {
            nbrOfPressedKeys++;
        }
        if (Input.IsKeyPressed((int)KeyList.W)) {
            nbrOfPressedKeys++;
        }
        if (Input.IsKeyPressed((int)KeyList.D)) {
            nbrOfPressedKeys++;
        }
        if (Input.IsKeyPressed((int)KeyList.A)) {
            nbrOfPressedKeys++;
        }

        if (nbrOfPressedKeys > 1) {
            if (Input.IsKeyPressed((int)KeyList.S) && Input.IsKeyPressed((int)KeyList.D)) {
                transform.z += (verticalMovement / 2) * delta;
                transform.x += (horizontalMovement / 2) * delta;
            }

            if (Input.IsKeyPressed((int)KeyList.S) && Input.IsKeyPressed((int)KeyList.A)) {
                transform.z += (verticalMovement / 2) * delta;
                transform.x -= (horizontalMovement / 2) * delta;
            }

            if (Input.IsKeyPressed((int)KeyList.W) && Input.IsKeyPressed((int)KeyList.D)) {
                transform.z -= (verticalMovement / 2) * delta;
                transform.x += (horizontalMovement / 2) * delta;
            }

            if (Input.IsKeyPressed((int)KeyList.W) && Input.IsKeyPressed((int)KeyList.A)) {
                transform.z -= (verticalMovement / 2) * delta;
                transform.x -= (horizontalMovement / 2) * delta;
            }
        } else {
            if (Input.IsKeyPressed((int)KeyList.S)) {
                transform.z += verticalMovement * delta;
            }
            if (Input.IsKeyPressed((int)KeyList.W)) {
                transform.z -= verticalMovement * delta;
            }
            if (Input.IsKeyPressed((int)KeyList.D)) {
                transform.x += horizontalMovement * delta;
            }
            if (Input.IsKeyPressed((int)KeyList.A)) {
                transform.x -= horizontalMovement * delta;
            }
        }
        base.Translation = transform;
    }
}

Everything works when I test with the editor. However, when I export the project to Windows Desktop and run it, the engine open/closes with the screenshot error (https://prnt.sc/krf2or) on the command prompt.

My export settings (default):
http://prntscr.com/krg69z

My export templates:
http://prntscr.com/krg6pr

Can anyone help me with this?

Thanks in advance!

in Engine by (12 points)

Please log in or register to answer this question.

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.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.