# RegisterChat (+4 overloads)

<table data-full-width="false"><thead><tr><th>Overload Methods</th></tr></thead><tbody><tr><td>RegisterChat( string message )</td></tr><tr><td>RegisterChat( string username, message )</td></tr><tr><td>RegisterChat( string message, UltimateChatBox.ChatStyle style )</td></tr><tr><td>RegisterChat( string username, string message, UltimateChatBox.ChatStyle style )</td></tr></tbody></table>

{% code overflow="wrap" lineNumbers="true" fullWidth="true" %}

```csharp
using UnityEngine;
using TankAndHealerStudioAssets;

public class ChatBoxExample : MonoBehaviour
{
	// BE SURE TO ASSIGN THIS IN THE INSPECTOR //
	public UltimateChatBox chatBox;

	void Update ()
	{
		// If the space bar has been pressed...
    		if( Input.GetKeyDown( KeyCode.Space ) )
        	{
        		// Register a basic chat from PlayerName in the bold username style.
        		chatBox.RegisterChat( "PlayerName", "This will be the content of the message", UltimateChatBoxStyles.boldUsername );
        	}
	}
}
```

{% endcode %}
