Set Variable

This will set the health to max health on Awake.

public class GKObserverHealthOwner : MonoBehaviour
{
    public FloatVar health;
    public FloatVar maxHealth;

    void Awake()
    {
        // DO NOT USE health = maxHealth, Always add .Value after the FloatVar
        health.Value = maxHealth.Value;
    }
}

Last updated