Make your first 2d game need help with c#

Godot Version

4.2

Question

Hey, I’m very new to coding only have experience in unreal. I’m following the Gogot doc for making your first 2d game. ( Here

I’m giving problem errors even when i’ve copy code straight from the doc into my script. Any help please?
My code

using Godot;

public partial class Player : Area2D
{
[Export]
public int Speed { get; set; } = 400;

public Vector2 ScreenSize; 

}

Errors

P.S. if there is any books or online tutorials you would recommend please let me know

I just tested myself in 4.2.2 and it worked just fine. I guess just check that you made sure that the name of the node is the same as in the script. The code itself shouldn’t be running into any errors if you make sure to follow the thing closely

Hello, show the whole file. Somewhere is missing ;.

From what the tutorial shows, this is the whole file(notably the same as the original poster’s code).
(Copy and pasted directly from the documentation)

using Godot;

public partial class Player : Area2D
{
    [Export]
    public int Speed { get; set; } = 400; // How fast the player will move (pixels/sec).

    public Vector2 ScreenSize; // Size of the game window.
}
1 Like

you needed put whole error,
errors at (10,3), (10,33) and (18,1)