# Register(Guid, UnityAction<MessageEventArgs>)

> Registers a callback on a certain message ID.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor.Networking.PlayerConnection](/engine/6000.7/script-reference/unityeditor/networking/playerconnection.md)
* **Assembly:** UnityEditor.CoreModule

```csharp
public void Register(Guid messageId, UnityAction<MessageEventArgs> callback)
```

### Parameters

**** (\[Guid]\(https\://learn.microsoft.com/dotnet/api/system.guid)): The message ID that invokes the callback when received by the Editor.**** (\[UnityAction\<MessageEventArgs>]\(/engine/6000.7/script-reference/unityengine/events/unityaction)): Action that is executed when a message with ID `messageId` is received by the Editor. The callback includes the data that is sent from the Player, and the Player's ID. The Player ID is used to distinguish between multiple Players connected to the same Editor.

### Remarks

The message ID must be the same as that used in the PlayerConnection.Send().

There can be multiple registered callbacks for one message ID, and these can be deregistered individually with [EditorConnection.Unregister](/engine/6000.7/script-reference/unityeditor/networking/playerconnection/editorconnection/unregister.md).
