I'm wondering what the optimal way to start and stop playing visual effects with client side prediction? One of my visual effects loops until you stop it in code. I'm worried if I start & stop it in the replicate function it will call the visual effect to start playing many times per second and cause performance inefficiencies.
Currently I am checking to play a visual effect like this
if (!playerController.currentReplicateState.ContainsReplayed() || (!playerController.IsOwner && playerController.currentReplicateState.IsFuture()))
And this works but the visual effect plays late when ping is increased. Also the if statement sometimes is skipped by a large rollback occurs and the state is completely skipped in my state machine. I could simulate playing the visual effect to a certain tick but after reading about the performance problems it could cause I am concerned about implementing that.
Are there any examples how to start/stop visual effects with prediction v2? I want to make sure it's as optimized and accurate as possible. My game is designed to be very competitive and every tick matters.
Also I am on the most recent version of Fishnet Pro.