So I want to create a way for the clients to see a little VFX when a specific “marker” is reached using :GetMarkerReachedSignal(). And I’m using this
task.spawn(function() -- On the client
IndicatorConnection = Track:GetMarkerReachedSignal("Parry"):Connect(function()
Event: -- fireserver()
end)
end).
What I want to happen is that the RemoteEvent fires then the Server fires to all clients which then Emit the VFX. But the problem is that would take too long as a ParryIndicator/the animation is too quick compared to the ~100ms + it would take. I know Deepwoken has this fixed but I’m not sure how they do it
my first go to is trying to get the marker signal from another player’s animator locally.
i have done some research, and it seems we cannot get another player’s animation signal directly because we can only get an AnimationTrack from animator:LoadAnimation()
it seems not likely that the server can receive that marker signal, or Animator.AnimationPlayed event
but we could send a remote event to server along side when we play the M1 animation,
hopefully the event would reach server around same time as the animation replicates. we will then FireAllClient(thatPlayer, whichAttackOrAnimation, workspace:GetServerTime())
on our local player receiving this information, we also use GetServerTime() to compare with the received server time to know the elapsed time. and from the whichAttackOrAnimation, we might get from a config file that say when the parry window is. and then do the local vfx based on elapsed time
I don’t understand how this would solo the problem since time still elapsed when the client sent the event to the server and server sent to the clients.
if you send event when server received the animation event, then it is (animation event time + ping time) after client received it
if you send event at animation start, then it is min(animation event time, ping time) when client received it
for example. say, the parry is 1 sec after the animation start, and ping time to client is 250ms
if you send it when server has parry animation event, then client received it at 250ms after parry animation should start.
if you send it at animation start, client received at 250ms, and then client know to start parry after 1 sec. so it is on time