Basically I am eventually making my game multiplayer, so this isn’t necessary immediately, but I was wondering how it would work.
Essentially I want to make a highlight system for units or game objects for when a player is targeting with an ability. However, I am curious as to how the highlight object I create could be spawned in only for the local player?
The highlights are only visual, so they don’t need to be displayed across the network, just locally.
If it is just visual, I wouldn’t make it a networked object at all unless you want other clients or the server to know of its existence (which it sounds like you don’t need). I’d have it instantiated only on that local client then. You could trigger its instantiation from the server using a TargetRpc or ClientRpc, or just do it all from that client.
Ahh right, that seems far more simple than I was expecting. Though now that you mention it I may end up having targeting data shown across the network (as some feedback during other, allied players, turns). Still, that’s more likely to involve passing the current targeting data and having each client make their own highlight objects.
Yeah in that case you could send a Command to the server with just the targeting data, which updates a SyncVar or one of the synclists with that data for the other clients to know about.