How to call a MainClass Funktion ?

Two questions:

I am writing a multiplayer based game.

All GameObject should be instantiated from in my GameController script.
How i can call a funktion of a script atached to a GameObject from another GameObject for example a skript which trigger if a key is pressed in my player prefab ?

Also this should only be executed on the server so i neet to check:

if (network.isServer)

right ?

Thanks and greetings


it looks this is related to accessing members from another script. There are hundreds if not thousands of example over this forums and google. - unitygems Resources and Information.