Solution for accessing other object’s script from a script

When developing game with Unity, sometime you will need to access the other object’s script to maybe change it properties or run a function which is inside that script. Here is a scenario which I’ll need to access the script from other object:

I have an object called GameManager and It had a bool value (true/false) called “pipeCanMove” to decide whether the Pipe object should move (player start moving then pipe’ll start moving). The problem here is how can we know when the player is start moving and how

Leave a Reply

Your email address will not be published. Required fields are marked *