Does AnimMontage play on a dedicated server for the purpose of collisions?

A friend and I have spent days trying to figure out this issue. Here is what we have: A player character with a collision sphere snapped to the hand_l bone. As the player punches with an AnimMontage we want the sphere collider to fire an overlap event with other characters in a multiplayer environment. I am using RPC calls to generate the events up to the server and var notifies to replicate them back to other clients. The animations are correctly playing on all clients and I can see the sphere colliders moving with the punches.

When I run the game using 2 players and dedicated server unchecked it works fine and fires the overlap event correctly. I can punch on either the client or the client+server and it generates the correct overlap events. However, as soon as I check the dedicated server option, the overlap events no longer fire. I can step through the blueprints and watch the server side playing the AnimMontage, but yet the overlap event still does not fire. I also found that the overlap events do fire if overlapped in their original location (with the left hand at the side of the player). So I can only assume one of two things is happening.

Either the AnimMontage is not moving the skeleton on the dedicated server (maybe this is optimized out?) or the sphere collider is not moving with the mesh on the dedicated server.

If I am willing to have the collision be executed on the clients, this setup also works fine, but I need the server to be authoritative when it comes to attack collisions.

Any ideas??? Is there a way to have the dedicated server be a third window and show what is happening on the dedicated server?

*For anyone trying to replicate this, there is an issue with the root capsule component of the character never firing overlap events. I have seen Epic staff elude to the fact that the root component collider is special somehow, so I got the overlap working by creating an exact copy of the capsule collider. Then the overlap events fired correctly (just not with dedicated server option checked).

4 Likes

I finally figured it out!!! So I narrowed it down to the fact that the skeletal mesh was not animating on the dedicated server. I did this by creating a socket and printing the sockets transform location to the screen. With dedicated server turned off, it moved. With dedicated server turned on, the socket never changed location. So then I decided I would try changing every single setting on the skeletal mesh until it worked. Finally when I set “Mesh Component Update Flag” to “Always Tick Pose and Refresh Bones” it instantly worked perfectly and all of my collision events fired as expected!

5 Likes

Dude, you are just a genius! I have been more than a week with this issue, thankssss!

1 Like

I’ve also been trying to get it to work for days, thanks for pointing it out.

Just stumbled across this post after days of rewriting replication code - this was the problem after all! Thank you

You Sir. Deserve cookies… your entire life

Well… I just wasted 6 hours working out what was causing havok with my aim system… and then I found this. Thank you, seriously, majorly. You rule.

Holy Butter balls can’t believe I wasted 3 hours on this ■■■■! Thanks man

Hey Epic consider always update transform as default setting so as to prevent some noob frustations
well part of me is guilty too because I didn’t try hard enough like he did trying to trace with sockets and stuff , but still it was nuts

Can’t believe I spent hours this morning trying to figure this out. Thanks a million!

Thank You very much! It saves a lot of our time!

As the other said… Yes, indeed. Thank you for your time!

Hi, Thanks a lot for this hint. I also spent hours (or even days) trying to find out why my sword mechanics did not work on dedicated server. You saved me from going mad :wink:

Thank you a lot =)

Sorry guys, but I can’t find this flag… anybody would be kind enough to tell me where it is? I’m losing it here.
edit: ok i found it, but how could I make it default for a blueprint inheriting from Character?

Would you mind telling us where you found the Mesh Component Update Flag? Having trouble finding it myself.

Yes! sorry. You have to select the Mesh on the Character Blueprint Viewport and then you’ll find it on the right details dialog. You can search for “Component” on the search bar to filter, it’s under the skeletal mesh section

It seems to be a bad idea to tick pose and refresh bones both for client and server even if actor is not rendered. If you gonna have a lot of skeletal meshes in the level then they are gonna tick all the time. It will cost a lot of cpu on both sides and your money that you gonna spend on dedicated servers.

I’m also using the same technique right now, but looking for something more optimized, because there gonna be 50+ actors with skeletal mesh so this option with kill my dedicated server. Have you found other solution for that problem?

For the future:

This feature is now under “optimization” group and It’s called “Visibility based anim tick option”

1 Like

This answer saved me a lot of time. Thanks.

Hello pelykh,

I have the same problems and the same thoughts about that option. But did you ever found a answer /solution how to solve that problems?

I got a similar problems and AI pawn bones are not hitting player bones when no “server player” is rendering the client and the AI. Only “Visibility based anim tick option” solved it when set to tick on pose and bones.

My problem described here, but it is the same topic.
https://forums.unrealengine.com/development-discussion/blueprint-visual-scripting/1437465-weird-issue-in-mp-only-on-dedicated-server

If you ever found out a better solution instead setting all 50+AI to that option, please tell us.
Thanks a lot