The server don't play animations if there is no one to watch it

I have problems with the position of the weapon.
I think it’s because the server is not playing any animations. To save CPU and memory i guess, because there is no one to watch the animation.

This is causing problems to me.
Because my character is in “Idle” in the server wolrd while in the client world it is in a weapon position.

So the weapon is in different places at same time and i can not spawn projectiles well.

Then I need the server to play the animations even if there is not one to watch it.
How do I do this?
Or any alternative solution?

Thank you so much!!


NOTE: The problem happend only when the server is not watching the client character, otherwise all works well…


Edited:

I tested the default Third Person Project Too (Untouched), the same thing happend… so must be something normal ¿Or Not?..

Anyway I need the same weapon possition in the server… and the server character is not moving. ¿How to solve it?

I used the client weapon position to spawn the projectile on server… there is not other way if the server is not playing the animations.

If it is to increase the performance, i don’t know what is wors, if do not play animations or replicate an actor pointer. i would like to know it.

I am on UE 5.2.1. I see what you mean. However, my animations are still playing on their own instances even off screen (on client and server). But the bizarre behavior is if I add a print string and print a replicated variable, such as player pitch, it will not print the correct value. Even though the information is correctly updating, it will only print the pitch value when the player is on screen (or very close to being on screen) to the other player. A copy of the animation blueprint is shown only in that case, evident by the print string appearing on screen, then going off screen when the player is off screen of the other player. I am not sure why this is happening. Doesn’t make much sense to me why the pitch value would update correctly, but not print the correct value inside the animation BP.

1 Like

I’m using 5.3.1 now
i didn’t realize this behavior before and i’m using Unreal since the 4.27 version.

The test must be done “Playing as Client” or “Playing as Listen Server” but in this case where the payer host can not see the client.

I belive the engineers progamed it like this because the perfomance. It can has sense, if no one can see the animation then maybe is better do not playing it because the skeleton has a lot of bones to caculate its movement. So i think in this case they only update the Transform (Location, Rotation and Scale).

But it is a pain for programers. First because i spent three days to know this (and what a headche, i almost become crazy). You was the only one helped me. :heart:
And second because now i can not trusth in the server values.

Afortunately i fixed my code easy and now it works well. But i replicaded a actor pointer. I would like to know how many bytes are sending through the network each time i´ll change this variable… 8 bytes? Or the entire size of the class?. Becase the first case is Ok. But the second case mabye i must to do it in other way.

1 Like

I’ve never really noticed this before because I never had issues with the animations, and anytime I would use projectiles I would spawn them from a fixed location attached to the character root, like the capsule with an offset, rather than a bone. There has to be some way to override this behavior though in c++ at least. I’ve never looked into it.

1 Like

I also thought that. I was looking for information about it and couldn’t find anything. I hope that someone who knows how to do it reads this post and teaches us how to do it. That would be great.

This is a nightmare.

I have a laser gun. When a client shoots another client within the host’s field of vision I can apply damage and see the particle system.

But if the shooter is not in the host’s field of vision, the laser cannot be seen nor can it inflict damage.

I mean, seems like in the server world only happen things when the server is watching.

That’s crazy.

Now i think my bones theory is wrong…

This must be the biggest bug in the Unreal history.

I don’t know what can i do… i can not work like this.

I don’t have any of those issues, are you sure you are spawning all the actors on the server and giving them the correct ownership?

i think so… i’m using the default game mode in a empty Level… basicly i’m doing nothing

Sin título

Look this:

When the client is far away from the server field of vision can not apply damage

When the client is far away from the server field of vision, the server can not see the laser.

There’s quite a few reasons this can happen (don’t recall them all now). But start with ticking Always-Relevant anyway… Bump up Net-Cull-Distance-Squared… Look for a tricky little setting on the animation side (animBP maybe) about always ticking bones. You might have to search to find more threads about this topic. As there are other possibilities too if none of these fix it. :wink:

1 Like

By the way, when you click on the mesh component in the player character, there is a setting called “Visibility Based Anim Tick Option”. The default is to only tick pose when rendered, but you can change this to always tick pose, or always tick pose and refresh bones. See if that helps you at all, but honestly it will probably be a big performance loss.

1 Like

it Is not the distance… it is if the server can see the client or not… when the server see the client all work fine.

Thanks for the tips… i wil try it

i will try it.
Thank you so much!!

This fixed everything.

Now even the animations in server side are playing (Anim instance).

The only question I have now is if this is temporary (some version 5.3.1 bug).
I guess we will have to wait for version 5.3.2 to find out.

I think the nightmare is over!!
You Rock!!! I love you so much!!! :heart: :heart: :heart:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.