Game/MansionGame.Effects.cs

A method on the MansionGame networked game class that broadcasts a one-shot particle effect to all clients. It calls Effects.Play with a prefab path, position, and rotation so each client spawns the effect locally.

Networking
using Sandbox;

namespace BrickJam;

public sealed partial class MansionGame
{
	/// <summary>
	/// Broadcast a one-shot particle effect to every client (each spawns it locally). Use for host-side
	/// gameplay events - deaths, attacks, pickups - that all players should see.
	/// </summary>
	[Rpc.Broadcast]
	public void PlayEffect( string prefabPath, Vector3 position, Rotation rotation )
	{
		Effects.Play( prefabPath, position, rotation );
	}
}