Help me please.

I have a problem. I am changing the state of a bool in another script but I don’t know how to make something happen in my other script. I can’t use Void Update because that happens every frame and I can’t use Void Start because that happens when I begin the game. Is there any other way I could do this.

P.S sorry for the description but I don’t really know how to explain the problem. Also sorry for the title. I do not know what I should of used.

Use a property for your bool like so :

public bool MyBool
    {
        get { return _mybool; }
        set
        {
                _mybool = value;
                //call a method or do something else
        }
    }
    private bool _mybool;

This way whenever another script sets the value of MyBool, you can execute whatever logic you need. You could also add a check to validate that the new value is different from the current value before executing your logic.

Tut tut… use descriptive topic titles :wink:

You sir, are amazing. Thanks!

I tried. I honestly could not think of a title. Hell, I could just about describe the problem I had.