Skip to content

Commit

Permalink
fix spawning glitch
Browse files Browse the repository at this point in the history
  • Loading branch information
plaidpants committed Feb 6, 2022
1 parent b289bc1 commit 4376ba1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Assets/RocketSphere.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ public class RocketSphere : NetworkBehaviour
AudioSource hyperspaceSound;
AudioSource engineSound;

AudioSource [] musicLoops;

public GameObject explosionPrefab;
Rigidbody rb;
[SyncVar] Color RocketColor = Color.white;
Expand Down Expand Up @@ -460,8 +458,11 @@ void Update()
if (!rocket)
return;

// make sure the state matches the server state
if (visible != rocket.activeSelf)
// make sure the state matches the server state,
// don't do this on the server as you may enable the ship
// while it is spawning in, this is only for clients
// to catch up the other rocket enable states in the game
if ((visible != rocket.activeSelf) && isClient)
{
rocket.SetActive(visible);
}
Expand Down
Binary file modified ProjectSettings/GraphicsSettings.asset
Binary file not shown.
Binary file modified ProjectSettings/ProjectSettings.asset
Binary file not shown.

0 comments on commit 4376ba1

Please sign in to comment.