0
\$\begingroup\$

When I use NetworkServer.Spawn(ob) t instantiate a game object 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 seconds to align with the transform.parent which is the player.

Example : Instantiating a GameObject containing a ParticleSystem which gives the parent somewhat an effect, like smoke or something. On the host client every object has smooth movement whereas on the connected client it goes very rough and slow, like every game object running at a low fps except the main client player prefab

So I was thinking of 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 client's game. It might not have the same particle movements, but it wouldn't make a difference

Here's the child prefab's network identity and transform:

Inspector configuration

\$\endgroup\$

1 Answer 1

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\$
3
  • \$\begingroup\$ Isn't it UpdateRate == How smooth the object is seen ? \$\endgroup\$ Jul 5, 2017 at 18:47
  • 1
    \$\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, 2017 at 18:45
  • 2
    \$\begingroup\$ This answer would be better if it explained how to solve this problem with remote actions. \$\endgroup\$
    – DMGregory
    Dec 16, 2022 at 9:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .