Animation works on client, not on server...

The best way to explain this was to create a video. I press Q locally, and it gets all local Players, gets their animated skeleton, and runs an animation. Why doesn’t it work on server like it does on client?
Any thoughts?

Is movement being told to replicate for MyCharacter?

I admit, I had the same issue, posted on the answer hub, but never got a response. The 4.1 update however fixed the issue for me.

Did you watch the video? it’s only like a min long. I don’t know what movement has to do with directly triggering an animation from a keypress?!?

The keypress event only fires on the client, it doesn’t get transmitted to the server. You need to create a RPC to send that information over.

Is nobody taking the min to watch the video before they respond? It’s a listen server and client connected to that server. I keypress on the client, it animates. I move over to server, keypress, and it does like 1 frame of animation and then stops… I don’t mean to sound unappreciative here guys but randomly shouting out fixes, when you haven’t looked at the problem, isn’t helping…

I have watched your video, not 100% sure I understand the actual issue from what was shown in the video. If I had to guess its a replication issue, in which everyone that has responded to you has mentioned this as well to perhaps give you the direction to self research and resolve your problem.

Please pull up the Video Tutorials about Replication / Networking & Blueprints and watch through them. I am certain you will find the answer you seek there. If it doesn’t solve your problem then you could probably elaborate on the issue further with your new found knowledge and rule out what it is not and then perhaps get a more direct answer as to what is left.

As it sits I am pretty certain its a replication issue.

What OSIAS said, plus using key stroke and a get all object of your pawn class inside a pawn instance is really bad practice.
Go watch Epic’s tutorial and then start doing it the proper way, I probably know why only client works but doesn’t even bother to comfirm it because you seriously need to be more polite when you are in the need.
(Interesting thought experiment anyway for those who come across this thread and understand replication, and why I even leave a useless comment.)

First: I apologize if I am coming off rude however I am under the assumption that everyone here knows more than me about this product. I’m no greenhorn to coding, animation, or netcode. I’m merely new to UE4.
Second: I fully understand replication. I’ve watched all the videos, even did a few of the tutorials. I have NO replication in this other than pawn positioning
Lastly: I created a basic blueprint that (locally and without replication) responds to the key press of Q and plays an animation on every skeleton in the scene (again, locally). Yes, I know this is bad practice (in production), but for testing purposes, and to locate a bug, it is perfectly legit. Not only do I show the blueprint on the character in the video, but I show the mouse clicks as I change scope from each target (play mode on client and on server) and perform the key press. It clearly shows the animation looping on the client and clearly shows the animation begin and stop on the server… Same logic is run locally on each (regardless of it being proper technique or not).

So, I’m not trying to insult anyone here. Yes, I’m in need, however I was really hoping that those who can take the min to understand the issue could chime in on if it’s an error on my part (logically, it should be sound) or a potential bug with animation on a listen server. Assuming I am replicating a key press through the network when I showed the blueprint, and showed my control switching to the other client, would quite obviously be an erroneous assumption…

I am not sure how to help you beyond what I have said. Its a brand new engine for everyone and from the sounds of it you probably know more about it than I do.

However you said you created a blueprint without replication, but then you seem surprised when it wont replicate. I am confused? Also it seems that there is a standard way to go about doing this, but you do not want to try it that way and see if it works? I would get it working the way its recommended, make sure you fully grasp that and then apply it to whatever it is your attempting to do.

Just saying Hoss

ITS LOCAL LOGIC!!! WHY WOULD IT NEED TO REPLICATE??? I’m surprised (and rightfully so) because replication has nothing to do with this… But everyone (who’s been here <30 days longer than me) chimes in with guesses. Should I share the project? Would people actually try it?

If I open a program up on computer A, and the code detects for key presses on THAT COMPUTER and responds to it, and it does, why would it need to replicate??? It’s a local operation, it shouldn’t have anything to do with replication.
Also, the keypress and animation trigger are working JUST FINE!!! but, the animation (which isn’t replicated thank you very much) is stopping part way through on one instance but loops just fine on another. To further test this, I had it open up 5 clients and 1 server (the server is just a master client here people), and it does the same thing; animates fine on all the clients, but animation stops after first frame on server… No replication involved, I walk my **** over to each workstation, press the Q button, and watch the little man walk (animate). Go to next workstation, see little man standing there, press Q, and watch him walk. Etc, etc, etc… It’s a local operation…

Either I am blazing some new ground here, doing something wrong with the animation, or it’s a bug. Just because PenguinTD didn’t understand why I was grabbing all instance of character doesn’t mean I’m doing it wrong nor does it indicate that I am being arrogant in “proper procedure”. The problem IS NOT REPLICATION as I am not telling anything to replicate. I’m not replicating the key press. I’m not replicating any RPC commands. I’m not even replicating the animation state of the skeletal mesh. I’m just telling the darn thing to animate (loop) and the master client stops part way through the animation (as shown in the video) whereas any other client continues to loop through the animation. Other than 1 client being a master client, there is NO DIFFERENCE IN THE INSTANCES OR THE BLUEPRINT.

Edit: Really Epic? But (with 2 T’s) is naughty?

OSIAS is in line with my thinking as well; the biggest issue is that you seem to think replication is unnecessary - whenever you have more than one active client (or server / client) you need replication. Without being intimately aware of your project, the animations, and without seeing the rest of your characters blueprint, its hard to say exactly what’s happening; smart people can break things in interesting and unexpected ways.

I would have the button press call a custom event that is fired on the server, made reliable, and targets the characters mesh rather than everything of a specific class.

I honestly don’t mean to be so upset [I sound like a jerk], but there is an obvious miscommunication between all of us. I honestly appreciate the help but everyone is just looking at it from face value and not really realizing how simple this program is… Just because I used the word Server/Client doesn’t mean there is any replication involved, nor should there be.

I’m frustrated and I’m sorry. And I realize this is still early in the engine… But I’m saying “Hey everyone, what’s going on with this apple over here, it tastes funny” and everyone is responding with “Replication… Replication is obviously what your overlooking…” and next guy is saying “Did someone say replication? Well yeah, that’s tricky, obviously you dont know what your doing, you should go back to the docs/videos”… It’s very frustrating…

That is incorrect. As long as I am not replicating something, that means it is running locally on that instance. Once I replicate it, then, and only then, do I need to be mindful of the propagated result.

Well, although I appreciate the hidden flattery, I assure you this is all there is to it. What I have in the video, is all there is to the project. I started a first person template, added the blueprint you saw to the character, added a skeletal mesh and animation, and ran 2 clients (instance) which just happen to be linked in terms of position (replication). The blueprint should be running on each client locally, and it does that just fine. I don’t know how else to say: “Why is the animation stopping on this client and not stopping on that?” without putting up a really big sign and attaching it to a blimp to fly it over Epic’s studio…

Why? The button press is getting detected just fine. The play animation event is running just fine… It’s the animation, the animation is stopping on one, but not on the other…

There is no need to get worked up over this, even in the unlikely case that four people got it wrong. On the other hand, just saying “go look at the documentation and figure it out” is not very helpful either.

Anyway, your issue is related to the following comment in the code (SkeletalMeshComponent.cpp, line 466):
“Remote Clients on the Server will always tick animations as updates from the client comes in.”
In other words, clients on the server don’t update the pose automatically each frame.

This probably doesn’t solve your problem, but I hope it’s a good starting point.

That’s a good starting spot!!! THX! I’ll post what I find.

I was hoping the post being “NOOOO…IT’S NOT ABOUT REPLICATI…” all over again. LOL.
Anyway, I’d like to contribute something you are obviously wrong, Listen Server player is NOT a local “client”, I won’t go into details, because it’s all about replication and implementation from the source code side.
That’s also why I mentioned earlier I know roughly where went wrong in your case and would not bother to say a thing because you



cbuttner is being extra nice to help you out, I can’t and not even dare to claim myself to fully understand replication of UE4.
I just work harder to try understand it and posted answers and wiki trying to contribute, oh, thanks for categorize me as clueless for your bulletproof testing method.

Next time, don’t assume that people don’t understand why you do this or that, we just think it’s stupid way to even “not” trying setup replication properly and then jump into multiplayer.
I bet everyone even bother to leave a comment is because they probably more or less run into similar situations before, thus try to “guide you” to do it properly and then claim “it’s not working”.

Lastly, Character is default to replicate both the actor and movement, that’s also why you seem to get things running without much replication efforts.
Animation is driven by pawn state/movement component flags and variables(which is native and replicated), where you switch out the default TPP mesh, thus breaks what come with it.

Now, I am curious what you can find out.:cool:

Ok, I looked through the third person template (which plays the animation on the server just fine) and can’t find why the animation update tick executes as it should but won’t on the first person template. I see a dotted line on the event and in the animation graph but I can’t, for the life of me, find why that line is dotted (and animating)…
See this video for example:

I’m not sure what you were trying to accomplish here… Are you part of the “friendly” community everyone boasted Unreal to have? Why does the third person template work just fine with regards to animation then? I’ve gone through it with a fine tooth comb and can’t find why the third person template works and the first person template doesnt… Can you direct me? I’m guessing not because you’ve been about as helpful as you were before, spouting off how wrong I am and how not so wrong you are by: telling me to go read the ******* documents. I read the **** documents, I watched the **** tutorials… I’m a bit frustrated because I can’t find why something works in example A but doesn’t, under the same conditions, in example B (grade school level logic here). But… That’s not going to make you satisfied, that I’m stumped, is it? You want me to go read the **** documents again… You, who admittedly knows **** about replication is going to sit there and keep a ******* match going by adding fuel to a previously extinguished fire? What’s the correct way *******? What should I have done differently to get the little man to loop an animation when I hit any key? Your so quick to tell me that I am not doing it “properly” (without telling me anything extra) then go ahead, show me the “proper” way…

The Animation Blueprint in the Third Person template works by ‘inspecting’ the Character each frame for it’s speed/jumping state, and updates the animations accordingly. Our Character class automatically supports networking, so it will move on client and server, and hence the animation will work as well. If you are not using our Character, or you are adding functionality beyond basic movement, you will need to send the network messages yourself to get the animation to play. You can check out these videos on how to get networking set up for Blueprints: Introduction to Blueprint Networking - YouTube

I hope that helps!

I am using your Character (at least, I believe so, whatever is out of the box for both templates: first and third).

It seems to do the ‘inspecting’, that you speak of, on the animation update tick event. But what makes that tick event so different between the third person template and the first person template? Again, there seems to be an animated dotted line in the editor for that (per the video in my last relevant response) in the third person template but not in the first person template. I fully get that something is different between the 2, but where is it specifically. Is it a checkbox somewhere that indicates that the update ‘inspecting’ should happen every frame?

As for the first person animating update should work on movement, it doesnt update the pose when i move the remote client (from the perspective of the server).

Lastly, I’ve watched all the videos 3 times now (no joke)… I can’t see where this magic bullet is that your talking about. Please be more specific than just “watch 2 hours of videos, it’s in there somewhere…” Alas, frustration continues. If it’s such an obvious (and simple) problem, why can’t someone just point it out?

I’m not asking for anyone to create a game for me, please don’t mistake this as such. I’ve been a programmer for some big companies in the states (non games related) using everything from C to Scala over the last 20+ years, and done moonlighting game dev over the last 6 years with Unity, and earlier on, Torque. I’m very frustrated because the very first thing I want to try out isn’t working. I just want to press a key and every client’s model in the scene loops an animation. I understand I could be doing it much more efficiently however it’s one of those things where if I can’t even brute force the solution, then whats the point in switching?