Unity:Multiplayer Transformation lagging - unity3d

I am building a multiplayer game in unity.Currently facing an issue ,the players transformation lags in the other device it is connected too but the transformation is fine in its own device.Plus it also does not show the player transformation animation like walking etc.
NetworkTransform of Player

You can increase network send rate to avoid lag in movement. Currently it is set to 9 (as your image depicted) while for animation on network please see Network animator.
The NetworkAnimator is used to synchronize animations across the
network{tut here}.

In this case i don't use NetworkTransition i used synchonize position and update each Client.
https://docs.unity3d.com/ScriptReference/Networking.SyncVarAttribute.html
Second i reference use NetworkAnimator to solve animation synchonize issue:
https://docs.unity3d.com/Manual/class-NetworkAnimator.html

Related

Why does using PhotonRigidbody2DView give 'elastic' movement?

I'm currently using photon pun 2 to learn simple 2d multiplayer.
Using PhotonRigidbody2DView is giving an 'elastic' movement to the player. The player goes forward a bit and then returns to the original position.
Here's the video:
https://youtu.be/HgFVsofVZcQ
Why does this happen and how do I solve this?
I tried using PhotonTransformView and PhotonTransformViewClassic but it is giving weird results. The players go inside each other and when one player collides the other, the other player starts jittering.
So I decided to use PhotonRigidbody2DView instead. Now the players don't go inside each other and the jittering is also not happening but the 'elastic' movement problem is happening.
This happens because the remote client uses the velocity of the rigidbody to reproduce the movement of the character is does not control. This makes it a bit independent from the lag but for arcade style movement (where direction changes are immediate), this doesn't work all that well.
Solutions to this depend on what you actually need. Networked objects combined with physics can be tricky to get right. For PUN 2, we didn't implement a solution to this case and assumed you'd tweak the PhotonRigidbody2DView as needed.
The Smooth Sync package in the Asset Store seems to do well and is a plugin to PUN 2.
Alternatively, the newer Photon SDK "Fusion" should do better and is state of the art as networking solution.

How to prevent jitter with Network Transforms in Netcode?

We currently are working on a multiplayer game with Unity Netcode. The game is a racing game with relatively high speed. The player objects get synchronized with the Network Transform component.
We have the problem that the player is lagging a little bit (or junpig some steps forward instead of moving smooth).
The interpolate setting on the Network Transform makes it a little bit better but not completely.
Something we could observe is that when the own camera isn't moving, the other player isn't lagging at all, but since we have a racer game the camera moves all the time.
We could finally fix the problem. More information: https://forum.unity.com/threads/how-to-prevent-jitter-with-network-transforms-in-netcode.1387044/#post-8733624

My Netcode sample has frame skip problem even in a simple local network

I am using Netcode for a simple 1 vs. 1 football game.
Players and the ball have frame skip problem even in a simple local network.
I added the "ClientNetworkTransform" component to sync the positions of the players and the ball and even wrote a simple position sync component by myself, but both have the same frame skip problem.
by the way, I don't want to use interpolation because players and the ball slide while they move.
Here is the recorded video:
This is a Host-Client method. It also has this problem when I use the Server-Client method.
https://www.youtube.com/watch?v=HDWkdlzdNeQ
What is your suggestion?

UE4 - Changing ADS Camera when using a different weapon

I'm very new to Unreal Engine 4 and have been following an fps guide online!
Currently have an AK and M4 in the game and can switch between the two using 1 / 2 on the keypad. I had to setup the first aim down sights camera to the AK and it works well! However if I equip the M4 and aim down sights then the camera is no longer in the correct spot and it doesn't line up at all with the ironsights. So I added another camera called M4A1 ADS Camera, but can't figure out how to switch to that camera when aiming down sights then going back to the AK camera if using that weapon.
Is there a better way of doing this or any tutorials / tips to help with the process for the future?
If I want to try and answer your question I'd say that you should add a switch case or make branches to check wich weapon is equipped at the time.
But I'd say a better way to do this would be to add a camera to your weapon blueprint then you could access the camera from the weapon directly (assuming you have a master weapon class). This way you would configure 1 ADS camera per weapon and align it properly in it own blueprint.
you can use "Set View Targent With Blend" function to change your cameras, it is very good for changing speed, and blending other things.
I know this is old but even cleaner than Deimos's suggestion would be to have an ADS camera component on your character and attach it to a socket you create on each of your weapons. You can adjust the socket position and rotation on each weapon's skeleton and then all you do from the character side is attach the camera to the weapon any time you equip one.

Why player is lagging (local multiplayer)

Why my player lagging? I mean he is moving with 2 fps for enemy. Example: Player1 moves, in his screen all is ok. But player2 see player1 with 2 fps. And the same with player1.
Here is my prefab, and yes, I can't use RigidBody Transform
I think you could find the answer with very little research. The answer is quite simple though.
The reason why it's working perfectly on the client which owns the networking transform is because his input is directly reported to the game. On the other hand, the 2nd player has to send the information about his position to the host or simply the other players. The information is only sent a couple times per seconds.
You could increase the message sending rate of the networking but that's not really a good option. The best option would be to smooth the player's movement by assuming where he is going to be or move the player after it has moved already.
Here is a link about it : https://www.youtube.com/watch?v=Glm0nJ4sO5E