[UNET] Problems with syncing Weapon rotation

Hello Everyone,

im using this line :- transform.rotation = Quaternion.LookRotation (MyCam.transform.forward, MyCam.transform.up);
In the Update() Method To rotate my Weapon with the camera’s rotation

Now i want to sync this rotation over the network so other Players can see my Weapon’s rotation How do i do this? NetworkTransformChild is not working because the weapon is deep in the childs as its a child object of players hand

Please Help , TIA

Try making your weapon model a child of your camera. Then add at the root of your prefab a networktransformchild component with as target your camera.

-Speedex

Hey thanks for your reply
I really cant do that because i need my weapon to be parented to the hand so that it moves according to the animation :confused:
is there any other way of doing it?

Just send the rotation to the server at the same rate as you send movements. And then RPC it to clients and apply it.

We can only sync a RigidBody that way , so i have to use either MoveRotation or rb.rotation for rotating , but that snaps the rotation instead or smoothly rotating :confused:

What?
What I mean is when you are sending the player positions to the server. Also send the Weapon rotation.