How would I go about doing mutal animations on client with animation events

Currently, I am making a tower defense. The towers have animations when they are attacking, which must be seen by every client.

Animations on clients is a near must - It reduces serverload, is smoother (very important) and isn’t affected by player ping (stutters and jumps). However, I have specific animation events in each animation in which after firing, the damage will actually be done. This raises obvious security issues.

I’m thinking of using a math.random or something to create unique tokens for each animation event so that exploiters can only fire each animation event once - and if they fire it early, it’s not so game breaking because the time between that and the next attack animation will be the same regardless, so they aren’t getting any significant advantages. Since I’m using FireAllClients, I guess I will have to use the first one that returns back and shut out the others.

Another solution I thought of would be to just wait on the server to when each animation event will approximately fire, but that feels really hacky and shoddy.

Third and final solution I thought of would be to play two animations, one serverside and one client, but that feels really wasteful. Though this is by far the easiest solution, so I would like to know if the extra server load is worth the ease of this solution.

I want to know if anyone has done something like this before and are willing to help. If you have any better solutions, by all means post them. Thank you for your help!

1 Like