codeAPI Reference
s&box ScriptedEmitter: Particle emitter GameResource
ScriptedEmitter GameResource API Reference
ScriptedEmitter is a GameResource that defines a particle/VFX emitter with a prefab, used for spawning visual effects.
Type Signature
CSHARP
[AssetType(Name = "Scripted Emitter", Extension = "semit", Category = "Sandbox", Flags = AssetTypeFlags.NoEmbedding | AssetTypeFlags.IncludeThumbnails)]
public class ScriptedEmitter : GameResource, IDefinitionResource
{
[Property]
public PrefabFile Prefab { get; set; }
[Property]
public string Title { get; set; }
[Property]
public string Description { get; set; }
public override Bitmap RenderThumbnail(ThumbnailOptions options);
protected override Bitmap CreateAssetTypeIcon(int width, int height);
public override void ConfigurePublishing(ResourcePublishContext context);
}Properties
- PrefabFile Prefab { get; set; } - The prefab containing the particle/VFX system to emit.
- string Title { get; set; } - Display name.
- string Description { get; set; } - Description.
Methods
RenderThumbnail(ThumbnailOptions options)
Renders the prefab as a thumbnail image for the asset browser.CreateAssetTypeIcon(int width, int height)
Creates the asset type icon (💨) for the editor.ConfigurePublishing(ResourcePublishContext context)
Validates the prefab before publishing. Disables publishing if:- Prefab is null
- Prefab contains a ModelRenderer (invalid for emitters)
- Prefab contains a BaseCarryable (invalid for emitters)
Usage
Create a .semit file to define a particle emitter:
CSHARP
[AssetType(Name = "Scripted Emitter", Extension = "semit", Category = "Sandbox")]
public class FireEmitter : ScriptedEmitter
{
[Property]
public PrefabFile Prefab { get; set; }
[Property]
public string Title { get; set; } = "Fire Effect";
[Property]
public string Description { get; set; } = "A fire particle effect";
}Notes
- File extension is .semit
- Implements IDefinitionResource for metadata
- Prefab must contain particle systems, not models
- Prefab must not contain ModelRenderer or BaseCarryable
- Thumbnail is rendered from the prefab scene
- Used by the EmitterEntity and other particle-emitting systems
Was this helpful?