I am trying to learn how to use Godot, as I find it easier to learn than Unity, and have been following a tutorial on their official documentation page, I've managed to get to the
'Preparing for Collisions' section, and have created the Hit
signal, however, when I linked the nodes together, it created the function, and I wrote the code it said to put into it:
public void OnPlayerBodyEntered(PhysicsBody2D body)
{
Hide(); // Player disappears after being hit.
EmitSignal("Hit");
GetNode<CollisionShape2D>("CollisionShape2D").SetDeferred("disabled", true);
}
But when I run it and it gives this error:
Feature 'top-level statements' is not available in C# 7.3. Please use language version 9.0 or greater.
I assumed this meant I have to update C#, which I didn't think would be that much of an issue, I tried updating it through the dotnet-sdk
thing, but I'm not really sure what it is or how it works, and cannot find any other way of updating it in Godot. I apologise if this is a stupid question, I'm very new to Godot. Thanks in advance for any help.