#Server Side Hitbox checking with Client Side Animations

1 messages · Page 1 of 1 (latest)

kind kindle
#

Hello everybody. My question is:

How do you implement a system where the server checks hitboxes and the client plays animations, but the server checks hitboxes multiple times during the animation (based on the track)?

#

My attempts:

  1. Playing tracks on both client and server ❌ (track played 2 times visually)
  2. Sending track that the client played to the server ❌ (the server doesn't know that the track on the client exists)
  3. Playing track on the server ❌ (input delay)
thorn berry
#

Timed server stuff

#

Wym input delay on the last part

kind kindle
thorn berry
#

animation goes on the client

#

timed stuff on server

kind kindle
# thorn berry timed stuff on server

So basically calculating when a certain keyframe is reached on the server by calculating time between when the server receives the remote event etc. etc.?

tall veldt
#

or whatever it's called

#

then remote when animation starts, send timestamp etc

slim comet
#

cant animation events be used here then use remote events?

kind kindle
kind kindle
kind kindle
tall veldt
#

predicting animations is difficult..

kind kindle
tall veldt
#

i mean the rollback feature doesn't work very well for animationtracks

#

similar and seemingly related issue to sounds also

#
    RunService:BindToSimulation(function(deltaTime)
        if RunService:IsServer() then
            -- Forward inputs from server to all clients
            for _, player in Players:GetPlayers() do
                local humanoidRootPart:BasePart = player.Character.HumanoidRootPart
                local inputContext:InputContext = player.PlayerGui.InputContext
                module.storePlayerInput(player, humanoidRootPart)
            end``` this is so stupid...
#
    -- Play the explosion emitter if the grenade just exploded
    if previousGrenadeState ~= grenadeState then
        if grenadeState == Simulation.GrenadeStates.Exploded and grenadeTimer < 0.2 then
            grenade.ExplosionEmitter:Emit(100)
            grenade.ExplosionSound:Play()
        end
        previousGrenadeState = grenadeState
    end ``` compare if a timer is near zero and then play effect, or disable it, check every frame, like wot