Greetings All, long story short I’m trying to replicate Pharah’s Hover Jets Ability from Overwatch. Running this code on Server works fine, but Client just does a small jump but doesn’t do anything else. I’ve tried many routes to try and replicate the ability but can’t seem to get anything to work. (e.g. Custom Events for On Server/All, Switch has Authority, Replicated Timeline, Replicated Character Movement Component, etc.) Anyone who knows the proper work around for this task, your help would be much appreciated. Code snippet below, sorry for the spaghetti.
what are you trying to do exactly? and what result are you getting?
since character movement is replicated you could just do it on server but may get lag jitter.
regarding your code i think your input key will be null except on the owning client since its not replicated which could break your code
Basically while the player holds down Space Bar they will gradually fly upward for a set amount of time. If they let go of the Space Bar they descend and the current fly time rises back up to the set max fly time. If I test this with a Server and Client, Server executes this code flawlessly. However with Client they hop up only 1 time, land and do nothing else.
I also tested with a print string node to make sure that both Server and Client were updating the fly time by watching the number go from 120 down to 0 while holding down Space Bar. While I was testing different options I was thinking that the Input Key or the Timeline might have been the problem. Any thoughts on what a possible solution might be?
just set a bool ‘bisflying’ true on pressed and false on released. RPC this to the server and repnotify it back if you want client side prediction.
run all the logic on server. you probably dont want impulse thats used for one time bursts. try add force instead. also you may need to set the movement mode to flying