0
\$\begingroup\$

When I NetworkServer.Spawn(ob) a gameobject and make it a child of a transform.parent after it spawns on both the server and client it usually lags, meaning it takes some secs to align with the transform.parent which is the player

Example : Instantiating a GameObject containing a ParticleSystem which gives the parent somewhat an effect, smoke or something in that direction, in the host client every object usually has a smooth movement where as in the connected client it goes very rough and slow, like every gameobject having a low fps except the main client player prefab

So i was thinking spawning the same effect on both clients so it wouldn't have to sync from the server to the client which uses it instead it only would have to sync inside the clients game, it might not have the same particle movements but it wouldn't make a difference

Here's the child's prefab network identity and transform : enter image description here

\$\endgroup\$
0
\$\begingroup\$

Here is the link to documentation about remote actions, that's what you need https://docs.unity3d.com/Manual/UNetActions.html

Just one more thing, in the image the UpdateRate are insane (29), i dont know what you are building but, probably you dont need this. It's a better idea reduce this number and add some interpolation in the rigidbody of you object if you need smoth movement.

If you just dont need sincronization you can simply put update rate in 0. Done.

Good look

\$\endgroup\$
  • \$\begingroup\$ Isn't it UpdateRate == How smooth the object is seen ? \$\endgroup\$ – Lendrit Ibrahimi Jul 5 '17 at 18:47
  • \$\begingroup\$ Technically yes, but smoothing is usually faked with interpolation. You won't be able to achieve real time position updates over a network. The reason your clients are jumpy is because you are using the "Sync Transform" instead of "Sync Rigidbody" or "Sync Character Controller". "Sync Transform" is the only one that is completely uninterpolated. If you want smooth position syncing without a rigidbody, you will have to implement it manually. \$\endgroup\$ – Heckman Jul 13 '17 at 18:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.