Somthing thats only on the server?
If I want to have a timer that is only run on the server. Is the correct way of doing it to, create a timer in the GameMode class and give the value updated / replicated in GameState? So Players and Server always have the same value?
Or is it a other way of defining something that's only existent server or client side?
You can simply start the timer on the server using a server function to start the process!
Since the server function is the one calling the timer, it will only ever run on the server.
To avoid telling the timer to start multiple times, with included internet lag making the results go off a bit, (calling the timer multiple times will restart it), make sure to only call the server function while on the Server (HasAuthority())
The above is if you are over-precautious about making sure only the server ever runs the function
if you have confidence you will always check HasAuthority()
all you need is this:
The above timer call will only run on the server
Follow this question
Once you sign in you will be able to subscribe for any updates here