Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions Basic/2DSpaceShooter/Assets/Scripts/ShipControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,7 @@ public void TakeDamage(int amount)

void Fire(Vector3 direction)
{
fireSound.Play();

PlayFireSoundClientRpc();
var damage = 5;
if (QuadDamageTimer.Value > NetworkManager.ServerTime.TimeAsFloat)
{
Expand Down Expand Up @@ -499,6 +498,13 @@ void OnCollisionEnter2D(Collision2D other)
}
}

// --- ClientRPCs ---

[ClientRpc]
void PlayFireSoundClientRpc()
{
fireSound.Play();
}
// --- ServerRPCs ---

[ServerRpc]
Expand Down