• Godot Help
  • Print to output not functioning in C# Script

Trying to get this to work for quite awhile now. I'm a complete newbie so go easy on me :🙂
I've been following this [https://docs.godotengine.org/en/stable/getting_started/step_by_step/scripting_first_script.html](https://)
tutorial. Attached the script, when run there is no output. I've run Godot in verbose mode and seen no errors generated.

Version: Godot_v4.2.1-stable_mono_win64.

You may want to initially shield your eyes from the complex code that follows but hang in there.

`using Godot;
using System;

public partial class sprite_2d : Sprite2D
{
public void MySprite2D()
{
GD.Print("Hello, world!");
}

}`
I added the void otherwise it complained method must have a return type.
Am I doing something wrong?

Appreciate any help.

Yes I dare to answer my own question! 🙂

If anyone else is as green as me and trying to follow the aforementioned tutorial using C#,
make sure and visit here [https://docs.godotengine.org/en/stable/tutorials/scripting/c_sharp/c_sharp_basics.html#doc-c-sharp]
first.
The routine was never being called.

This works

`using Godot;
using System;

public partial class sprite_2d : Sprite2D
{
public override void _Ready()
{

	GD.Print("Hello, world!");
}

}`

Hello, world! 🙂

In this example, the constructor is incorrectly formed, e.g.

public MySprite2D()
{
    // your code here
}

Thanks for posting your solution too!