Hello everyone.
So i made a little top down RTS / Tower defense. The player build turrets and units.
The way i made the code : i am using a LevelManager.cs that handles all that.
it contains the list of the units ( objectpool ), manage the Queues for the unit spawning ( units spawn at fixed position , or get in a spawnqueue if not spawn poisition is currently available. It also contains all the team data ( Energy, ressources, ect… )
All that… via static variable and static function…
So my thought was : if i do it like that, all i will have to do will be to have this big level manager running on the server, and the clients will simply send their commands to it. the manager will do his thing and will send to the client which gameobject to activate… mostly.
That’s for the context… now the issue :
I got the players in… all good. But i just found out that running the levelmanager on"serveronly" , the data do not get pulled from it by clients. Like : Team1 is supposed to have the “levelManager.current_Team1_Energy” displaying the UI… but it is currently not…
What am i missing ?
I tried something th… removed the “Server only” on the levelmanager.networkIdentity and put [SyncVar] in front of my T01energy amount … It now gives me an error " Syncvar can’t be used for static variable" …
Did i simply miss something, or do i have to reprogram the entire game to make it 1 v 1 ready ?