Dedicated Server Build & Animations

Hey I have a rather weird question but I’m trying to find an explanation for some behavior I am seeing.

When on a Dedicated Server build target I know Unity will update the Animator values and times correctly but is it actually acting out the animation?

I have a melee combat system that relies on raycasting from points on a weapon during a swing and while the server is compiled as a Standalone build everything is working correctly and the server is sending registered hit events to the clients.
When compiled as a dedicated server everything still works correctly except It’s not getting any hits which leads me to believe the animator isn’t actually moving my characters arms which have the weapon equipped to swing.

I’m not sure if I worded this in a way that isn’t confusing but I tried.

I can confirm when running the server under the standard “Windows, Max, Linux” build settings the raycast start positions are updated with the bone positions during the animation.

When running the server under “Dedicated Server” build settings the raycast start positions are constantly in their initial state.

This is likely due to the Culling Mode of your Animator. If you have it set as Cull Update Transforms instead of Always Animate it will never move the transforms on your dedicated server builds since if you have no camera rendering everything will be culled.

4 Likes

It’s always the simplest things isn’t it haha, I’ll check it out. Thanks for your reply!

1 Like

Hi what did you find out? I’m interested to know this too for the same reasons you mentioned.

Are animations and bone positions updated in dedicated server builds?

I’m on Unity 2022.3.7f1 and this is not working, I have the culling mode set to always animate, but the events never trigger on the server. Is this working for anyone else?

EDIT:
nvm it works, it was my bad, the animations were set to only trigger if you were a host or client, but not dedicated server.

2 Likes

Worked like a charm! I was running into this issue for weeks, pulling my hair out and crying. I’m using Fishnet and Linux AWS Dedicated Servers.