Fishnet Version: 4.7.1R from Package Manager. Unity Version 600.4.0f1.
I have a question I would like to have confirmed properly.
Imagine a player with an ability that has a trigger. For simplicity, let's say he has a box in front of him. Any other players touching that trigger should get completely disabled - they shouldn't be able to move or do anything else.
For this, i've added a NetworkBehaviour called "HinderedState" to the player(s). That HinderedState has a SyncVar<bool> that gets set by the server when a client enters that trigger. I think this is where i went wrong.
When moving the player using runinputs and reconcile, that hinderedState is now not in the prediction / reconcile loop, meaning that when the client replays the last few ticks after a reconcile (if i understood correctly) it has HinderedState to true even though it should have been set to false in the last few ticks, right? Here's some pseudocode:
[Replicate]
private void RunInputs(....){
if (_hinderedState != null && _hinderedState.IsHindered)
{
_predictionRigidbody.Simulate();
return;
}
//Other stuff like activating abilities / simulating the rigidbody etc.
}
If this is the problem and I've understood everything correctly, I should add the hinderedState to my CreateReplicateData, right? But as that runs every tick, do I just poll the trigger? If then that trigger were to turn off / move in and out of the client etc. wouldn't that lead to jitter again?
I'm not sure I understood everything correctly and would be very appreciative of some help 😄 Thanks!