I was trying to send a pre-loaded animation track across a remote event, but it turned up Nil on the server side. is it possible to send an animation track across a remote event? (i want server sided hitboxxing for a GetAnimationMarkerReached connection, hence why i want the track. its being played on the client already, btw.
i want to have effects initiate as soon as it begins, not just on my screen (because i believe you cannot see other people’s particles cloned on client) so i do that to avoid too many remotes. just keeps everything where it makes sense to me.
The AnimationTrack instance is being created on the client, so it’s not going to exist on the server. It might exist in the array returned by Animator:GetPlayingAnimationTracks. You will probably have to create the AnimationTrack on the server
using :GetPlayingAnimationTracks is a terrible idea. that would be the worst for performance due to me trying to get a SINGLE track with a SPECIFIC marker. if two or more tracks were playing for some reason, the latency would be very noticable.
That is the single-most ridiculous thing I’ve heard today. There is absolutely zero impact to performance. You’d only be iterating over a short array of AnimationTracks to locate the one produced by a specific animation. Luau’s arrays are so optimized that it would take a serious number of elements in an array for an O(n) lookup to fall below O(1). This potential solution is no different from calling Players:GetPlayerFromCharacter, for example
Yes, but the Marker’s name would be shared by multiple different animations. trying to find one through an array would be messy the way i’m setting it up.
My suggestion was for the client to tell server to do its hitboxing .1s before it happens. So when the remoteevent arrives at server, 0.1s later, its the exact time to do hitboxxing.
What’s the context of the serversided hitboxing? It screams combat system but you never said and it’d be helpful to know how often the remotes are firing
But really what you have are two options:
Wait for the client to reach the marker in the animation track and fire the server to handle the hitbox code (Literally what @Ziffixture said, though you probably dont have to create the animationtrack on the server since your client is already replicating your character and therefore your animation appearance, could probably just do the hitbox code stuff)
Once the animation starts, start a separate thread that waits a specific amount of time to call the server to run the hitbox code, which should theoretically be synced to the client (@StonksMcHat already posted this as well but saying it again cause they’re right)
You could try to use .Touched but your asking to be exploited and isn’t that the whole reason you’re here asking about FE, Remotes, and Server sided hitboxes anyway
You said you were looking for a specific animation. You can locate the AnimationTrack produced by an Animation instance in that array. You should know what that Animation is at least. Nonetheless, the client should be the one to handle hit-boxes. The server only needs to weigh in on the legitimacy of the client’s claims. If other clients need to weigh in on VFX/SFX work, they can be informed of the ability activation by the server and associate the animation the same way the server does
absolutely not. this is a combat system, but like a said previously, i want to have effects for startup. not just after it reaches the marker. the point of the marker is that the animation is cancelable, stopping the move it you get hit during it.
also, .Touched is one of the worst ways to hitbox.