Top Down Advanced Joystick Controller

Hello folks!

I have issues with replication some variables from Character Movement Component. In my game I want to add gamepad support. The left stick is for movement, the right is for changing face direction.

When character is moving without pressing right stick, bool “Orient Rotation to Movement” sets TRUE inside Character Movement Component and bool “Use Controller Rotation Yaw” sets FALSE inside Character Defaults.
With pressing right stick these two bools become visa versa.

[Watch Video][1]

Changing these two variables from client to server sides don’t replicate, but from server to client works well. How can I fix this?

85483-first.png

Help, anyone, any ideas. Epic team mby you know how to solve this

Hi iRYO400

So the problem here is that things never replicate from client to server (the character movement component has special code inside that handles this for movement input). So if your variables are set to replicate then you need to set them on the server and then they will replicate out to the client. If you have any kind of lag though you won’t get an instant response so you really want to set them on both the local client and the server.

Do something like this for each variable. The custom event executes on the server and is reliable. It takes the setting from the player for what to set it at.

Let me know if that works for you :slight_smile:

Sorry for late reply. Preparing for exams :slight_smile:

I’m still don’t solve it. I found another implementation. Change character’s face direction via mouse.

Look pictures below, first is for mouse, second for right stick. WTF!!! They are looks the same. But Mouse edition replicates, stick not.

Solved!

There is the whole answer - YouTube

My bad was, that I checked True in MulticastCustomEvent “Reliable” checkbox.

Glad you got it working. That’s weird that making it reliable would cause that kind of problem.

You have to be careful with spawning on the server and sending the command back to players if they have some lag it will feel like the game is super unresponsive and slow.

I would use a console command in the level the put in some lag around 100 or 200 ms to see how it responds under possible expected network conditions.

What the command is need?