# Your First Script

## First Script

Example setup of a basic UnrealSharp class

```csharp
using UnrealSharp.Attributes;
using UnrealSharp.Engine;

namespace ManagedTestCSharp;

[UClass]
public partial class AMyTestClass : AActor
{   
    [UProperty(PropertyFlags.BlueprintReadOnly)]
    public partial int MyInt { get; set; }

    public override void BeginPlay()
    {
        PrintString("Hello from C#!");
    
        base.BeginPlay();
    }

    [UFunction(FunctionFlags.BlueprintCallable)]
    public void MyFunction(int myInt)
    {
        MyInt = myInt;
        PrintString($"MyInt set to {MyInt}");
    }
}
```

Now go back to Unreal Engine and it should compile your code and your class should be able to be found in the editor.

<figure><img src="https://4179970252-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fb0wzkekwYXS1rYy7c988%2Fuploads%2Fgit-blob-23d656e5c0f6b9b7f26bccb36c738ce7ac3c4d74%2Funreal_class_wizard.png?alt=media" alt=""><figcaption></figcaption></figure>

## &#x20;<a href="#debugging" id="debugging"></a>
