Unable to display animation blenspace inside of state machine for networked multiplayer game

Hello,

I am making my first animation blueprint state machine, but I find myself stuck trying to get a blendspace animation to play once the state machine enters the desired state.

I’ll quickly summarize my set-up, I have a state machine that controls animations for my character. Things like idle/walking/jumping are controlled by velocity/ground detection, while the crouching state is controlled by a boolean, which is copied from the character blueprint and actuated by keyboard input.

Here is what my character blueprint looks like:
image

Here is my animation blueprint:

Here is the state machine:

The state machine’s transition conditions all seem to be correct, I am able to enter, remain inside of, and exit all states as expected. However, my “Crouch” state, which is meant to display a blendspace crouching animation seems to get ignored. It will display animations from other states while in the crouching state based on their correct transition logic, in spite of verifiably being inside the crouching state.

image

It’s not an issue with the animation blendspace either, I’ve checked it, and it is entirely composed of crouching animations. Considering that it is directly hooked to the result node, I don’t see why it would fail to display.

I’ve attached a gif to this post to better illustrate the issue. Key here is that the footage shows that the state machine is following our character, but seemingly ignores the crouching state in spite of knowingly entering it.
Apologies for the low frame rate.

recording

Of course, a one minute gif can be overwhelming, so here are some screenshots to use as reference too. Anything to help me resolve the issue.

image
image

As shown in the gif, I am indeed capable of entering, staying at, and exiting the crouching state. But the blendspace connected to the result node inside the crouching state does not play, it simply gets ignored. And as shown at the end of the gif, there is no animation within that blendspace where the character is standing up, which means that the game is somehow displaying an entirely different set of animations from the ones the state machine is providing it.

For further context, this is a networked game. This post is a follow-up from another.

Thank you very much for any and all reply!

image
You can preview the animation by changing values in this window. So when checking Crounching, will your character do crouching animation?

Hello Majj_1089, thank you for replying to my post,

Unfortunately, this window does not appear to do anything whatsoever. I’ve tried changing any and all values inside it, and they instantly reset themselves with no visible change in the preview, even when changing values that do work during runtime like jumping or speed and direction.

I tried changing the values in the detail panel too, and while they do seem to persist unlike in the preview animation panel, they do not show any changes whatsoever in the 3D viewer either.

Upon further testing, I am beginning to think that this might be a networking issue, and not one to do with the animation blueprints.

image

I had previously attached a print to the result of setting crouch, which returned satisfactory outputs of true and false when due. However, attaching it to the event tick instead reveals that when the crouch key is pressed, it quickly undulates back and forth between true and false.

I’m not entirely sure what the cause of this could be, but I am happy to make any progress at all in attempting to find a solution.

Post update:
I have tried to lock input setting to local player only, but it did not yield any change in the results.

Second post update:
I have, hardly fortunately, confirmed that the issue is certainly related to networking. Lowering the client count to one results in expected behaviour.

image

This is problematic as I have no idea what the solution could be. For the time being, I’ll spend the night watching a few more multiplayer blueprint tutorials in hopes of finding useful information.

Hi, glad to hear that you have made some progress!

So will that make a expected crounching animation, or just the expected print text?

Hey @User-400315961!

Sorry for the late response. Yes, it is most likely a replication issue. On the Client, you want to use “ServerSetProperty” which will set the value on the server, and then “MulticastSetProperty” on the Server! Do this on the ABP and you should see it work!

Yes!

image

Since I haven’t implemented the camera moving down when crouching yet, I can actually see the third person model when crouching from first person if I look down :grin:

Thank you! I admit that I’m not sure how to do this, and google is not what it used to be, but I’m on hot pursuit through watching and reading courses on networking and multiplayer to better understand how to do it.

Either later today, or tomorrow, I’ll probably write a follow-up comment after I’ve learned how. I just wanted to reply ASAP to make sure not to give the impression that I’m neglecting those that would extend their hand to me. I really am thankful for these replies.

2 Likes

I got it working!

I admit, I don’t fully comprehend how this all works. The courses I followed were ambiguous as to how this works.

For example, it is strange to me that inside the same blueprint, I am setting the crouch value twice. I get that one of them is meant to be client → server communication and the other server → clients communication/syncing. But how and why is the same blueprint meant for the client’s character (handling input locally and what not) also executing code that should be handled by the server?
I can’t really tell if this is just me being too used to Unity or too unfamiliar with networking for games, either way, I hope to learn more about this in the future. I really look forward to documentation and tutorials catching up with the latest engine version.

Regardless, I am very pleased that the problem has been resolved.
Thank you!

1 Like

I’ve updated the title of this post to ensure that the answer is useful to those that search it online.

1 Like

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