NetworkView, Mouselook and syncing

Hello

I have an issue with synchronizing the Y-axis on the weapon in an FPS im working on.

What happens when i try to synchronize the position of the weapon is that half of the frames you will see the gun in its intended position, but when you stop moving the gun, the position gets reset to its original position.

My gameobject Hiearchy is set up like this:

root(the base mesh, the character)
|-Camera with a mouselook
|-Gameobject with a mouselook
 |-My gun

I have a networkview on the gameobject and the Root, to synchronize the movement, but with this setup i get the bug i described above.
I have tried the same setup, with a slight change:

root(the base mesh, the character)
|-Camera with a mouselook
|-Gameobject without a mouselook, still with the network view though
 |-My gun

what i did in this setup was to attack a script to the camera with these lines of code in it:

public GameObject objects;
void Update () {
	objects.transform.rotation = transform.rotation;
}

the issue i got with this method was some extremely choppy movement and lag between the gun and the Camera. the position of the Gun did get synchronized without any issues though.

Lastly i tried to have the gun as a child to the camera, which didnt work because all cameras but your own is disabled, which means that the rotation of the camera isnt synchronized.

So please help me out here, im more or less at my wits end, only thing i havnt tried yet, which i know of, is black magic.

Thanks in Advance

-Kacer

I don’t fully understand your setup however I have three suggestions:

1- increase tickrate
2- use LateUpdate
3- implement interpolation

Approaches:

1- edit=> project settings=> network. increase the value to 25 and verify if situation changes
2- if you have an animation running and your weapon is part of that animation, whenever you change the transform you need do it in the lateupdate, otherwise the transform gets overwritten
3- this is tricky. exclude the other two first.