# \[Sync] and \[Command] Attributes

Aside from configuring your CoherenceSync bindings from within the Configure window, it's possible to use the `[Sync]` and `[Command]` C# attributes directly on your scripts. Your prefabs will get updated to **require** such bindings.

## Sync Attribute

Mark **public** fields and properties to be synchronized over the network.

```csharp
[Sync]
public int health;
```

It's possible to migrate the variable automatically, if you decide to change its definition:

```csharp
[Sync("health")]
public float hp;
```

## Command Attribute

Mark **public** methods to be invoked over the network. Method return type must be `void`.

```csharp
[Command]
public void Heal(int amount)
{
    ...
}
```

It's possible to migrate the command automatically, if you decide to change the method signature:

```csharp
[Command("Heal", typeof(int))]
public void IncreaseHp(float hp)
{
    ...
}
```

{% hint style="warning" %}
Note that **marking** a command attribute only marks it as programmatically usable. It does not mean it will be automatically called over the network when executed.

You still need to follow the guidelines in the [Messaging with Commands](https://docs.coherence.io/1.2/coherence-sdk-for-unity/networking-state-changes/commands) article to make it work.
{% endhint %}
