How to get a server created timer information from a client ?
Sooo say I created a timer on authority only and wanted to retrieve the "remaining time by handle" from a client, how would I go about doing that ?
I'm using the remaining time and the initial timer length to feed into a progress bar on a UMG widget in order to show a powerup's remaining time to a player.
As an example I took the networking content example and tried to implement the following which returns a big fat zero on the client. I thought the value would show up on the client since I'm replicating the "float value" and the server definitely knows about the "timehandle" variable.
Any thoughts on how to retrieve timer info from a client's perspective and feed that into an UMG widget ?
asked May 09 '16 at 04:11 AM in Blueprint Scripting
The are timeline component, which have built networking functionality, besides that i can't think of efficient way to do so.
answered May 09 '16 at 09:45 AM
Your timer does need to be replicated (you can tell it isn't because it doesnt have those two bubbles on it) alternatively you'd have to build functions that retrieve the value as client call.
answered May 10 '16 at 08:46 AM
From my point of view replicating timers is bad practice... I would suggest you going in different direction. There is no sense in replicating timer statuses. Since you know their time on both sides - you can start them on both sides:
If you need reliable acknowledge after timer elapsed, set replicated status variable on server side or fire multicast event. ex: Dota2 Skill cooldown progress does not have to be replicated every tick or every 0.1s. User interface can run it's own timer locally. After cooldown time timer on server side will change skill replicates status to "ReadyToUse".
btw. Handles are not replicated because "timer" is a local resource... or entry in delegate list somewhere in engine main loop.
answered May 15 '16 at 01:46 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here