> For the complete documentation index, see [llms.txt](https://bennykok.gitbook.io/rhythm-game-starter/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bennykok.gitbook.io/rhythm-game-starter/note-prefab/customize-note-instance-in-runtime.md).

# Customize note instance in runtime

### Overview

You can link up your own method to do a custom logic when a note is being initialized.

![](/files/-Mi-WqPaM5QR4-boZK2X)

Examples from the Colorful Demo, check out the Colorful Notes Handler, which linked up with multiple event callbacks from RhythmCore.

![](/files/-Mi-XJitxPM4RRkKbtL9)

Example code to set the note to a random color on init.

{% code title="ColorfulNotesHandler.cs OnNoteInit method" %}

```csharp
//For receiving call back from the TrackManager's (onNoteInit) event, when a note is being init
public void OnNoteInit(Note note)
{
    var selectedColor = randomColors[Random.Range(0, randomColors.Count)];
    //Loop through all the notes, then assign a random color to them
    foreach (var renderer in note.GetComponentsInChildren<SpriteRenderer>())
    {
        if (renderer.name != "Swipe Indicator")
            renderer.color = selectedColor.color;
    }
    //We appends the color name to the the note object, so we can recognize it back later on
    note.name = selectedColor.name;
}
```

{% endcode %}
