0 votes

Help I get this error when trying to run my program how do I fix it so it will run thanks:

Failed to get modified time for: E:/Project Rift/MacAfee-Game/Mcafee Game/Scripts/C%23/SpriteMove.cs
modules/mono/utils/stringutils.cpp:168 - Condition ' err != OK ' is true. returned: err
modules/mono/editor/script
classparser.cpp:664 - Method/Function Failed, returning: ferr
modules/mono/editor/csharp
project.cpp:183 - Parse error:
Failed to determine namespace and class for script: res://Scripts/C%23/SpriteMove.cs
modules/mono/editor/godotsharpbuilds.cpp:383 - Condition ' metadataerr != OK ' is true. returned: false
editor/editor_node.cpp:4666 - A Godot Engine build callback failed.

My code is:

using Godot;
using System;

public class Movement : KinematicBody2D
{
[Export] public int Speed = 200;

Vector2 velocity = new Vector2();

public void GetInput()
{
    velocity = new Vector2();

    if (Input.IsActionPressed("right"))
        velocity.x += 1;

    if (Input.IsActionPressed("left"))
        velocity.x -= 1;

    velocity = velocity.Normalized() * Speed;
}

public override void _PhysicsProcess(float delta)
{
    GetInput();
    velocity = MoveAndSlide(velocity);
}

}

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 Frequently asked questions and 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 [email protected] with your username.