# UpdateHints

If you want that action hints to be changed, you need to call method `UpdateHints()` from interaction script.



For example:\
In this script, hint depends on `activityState`, which is changed in `OnInteractPrimary` method.

```csharp

ActivityState activityState = ActivityState.Off;

bool UsePrimaryActionHint() => true;

string GetPrimaryHintText() => activityState == ActivityState.On ? "Turn Off" : Turn On";

void OnInteractPrimary()
{
    GetCurrentPrimaryAction().action.Invoke();
    activityState = (activityState == ActivityState.On ? ActivityState.Off : ActivityState.On);
}
```



To make hints change, and show actual information, use method `UpdateHints()`:

```csharp
ActivityState activityState = ActivityState.Off;

bool UsePrimaryActionHint() => true;

string GetPrimaryHintText() => activityState == ActivityState.On ? "Turn Off" : Turn On";

void OnInteractPrimary()
{
    GetCurrentPrimaryAction().action.Invoke();
    activityState = (activityState == ActivityState.On ? ActivityState.Off : ActivityState.On);
    UpdateHints();
}
```



