[Server] vs isServer

What is the difference in using the [Server] attribute vs having the following at the top of a function?

if (!isServer)
return;

isServer is obviously more flexible because you can separate parts of a method while the ServerAttribute affects the whole method. Unless you use the ServerCallbackAttribute the ServerAttribute will also throw a warning to the console when the method is called on a client.
So if you are really just returning immediately if it’s not run on the Server one of the Attributes is probably the better choice. It also makes that design choice more visible.

1 Like