[SerializeField]
private bool _CharacterInControl;
public bool CharacterInControl => _CharacterInControl;
private void OnDisable()
{
Maki.Control.BlockPlayerChanged -= Control_BlockPlayerChanged;
}
private void Start()
{
Maki.Control.BlockPlayerChanged += Control_BlockPlayerChanged;
}
private void Control_BlockPlayerChanged(int change)
{
_CharacterInControl = (change < 0 ? true : false);
Debug.Log("Control Change: " + change + " IsControlled:" + _CharacterInControl);
}
It looks like you're new here. If you want to get involved, click one of these buttons!
In your component's Start function (or an OnEnable function) you could simply check if player control is blocked and set your bool accordingly:
_CharacterInControl = Maki.Control.Blocked;
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!