Unet Host only code

I can’t seem to wrap my head around how to run code only on the host. Not on the hosted version of connected clients, but if I have code that I want to run only one instance of, and only on the host, how do I do that?

I think that’s done by checking if (isServer) … so basically if (!isServer) return; would be put right at the start of any function you’re wanting to run only on the host.

1 Like