Per-type Methods
Most scripts use the dispatchers from the Emission chapter — :Emit(item) figures out the type and routes. But the plugin also exposes one method per type, so you can call the right one directly when you already know the type.
Two reasons to use these:
- Performance — skips the type-check the dispatcher does. Negligible per call, measurable when you’re calling thousands of times per second.
- Clarity — makes the call site self-documenting.
Part_Icles:EmitBeam(myBeam)reads more directly thanPart_Icles:Emit(myBeam)for a reader unfamiliar with the codebase.
Emit-mode methods (per-emission clones)
Section titled “Emit-mode methods (per-emission clones)”Each method takes the source instance and an optional link (an instance to follow, same as the Linking chapter’s Link property).
| Method | Source instance |
|---|---|
:EmitPart(part, link?) | BasePart |
:EmitBeam(beam, link?) | Beam |
:EmitAttachment(attachment, link?) | Attachment |
:EmitModel(model, link?) | Model |
:EmitPointLight(light, link?) | PointLight |
:EmitImageLabel(label, link?) | ImageLabel |
:EmitBlur(item, link?) | BlurEffect |
:EmitBloom(item, link?) | BloomEffect |
:EmitColorCorrection(item, link?) | ColorCorrectionEffect |
:EmitAtmosphere(item, link?) | Atmosphere |
Part_Icles:EmitBeam(workspace.MyLightning)Part_Icles:EmitPart(workspace.SwordTip.Spark, workspace.Sword.Tip)Per-type methods do an internal data lookup first. The lookup returns nil when the item has no PartIcleProperties Configuration child — that covers two cases: items that aren’t transformed at all, and Trail items (which use a different storage path and never get a Configuration). In both cases the per-type method returns early on not data and the call is a silent no-op.
Cross-type calls — :EmitPart(myBeam) for example — are not silently caught. myBeam has a Configuration, so the data lookup doesn’t bail; the function then reads type-specific fields and a mismatch will throw on the missing field. Use the dispatcher :Emit(item) if you can’t be sure of the type at the call site — it routes by IsA and never crosses lanes.
Trail has no per-type method. Trails use a different storage path (no Configuration child), so the data lookup returns nil. The supported scripted-emit path for a transformed Trail is :AbsoluteEmit(trail) — it falls into the native-Trail branch and toggles Enabled for the parsed EmitDuration. Or skip the runtime entirely and set trail.Enabled = true yourself.
Animate-mode methods (singleton looping clone)
Section titled “Animate-mode methods (singleton looping clone)”For each emit-mode method there’s an Animate counterpart that triggers Animate mode (one looping duplicate, no per-emission clones — see Two Modes for the model). PointLight is the exception: no :EmitPointLightAnimate since PointLight doesn’t have an Animate-mode use case in the plugin.
| Method | Source instance |
|---|---|
:EmitPartAnimate(part, link?) | BasePart |
:EmitBeamAnimate(beam, link?) | Beam |
:EmitAttachmentAnimate(attachment, link?) | Attachment |
:EmitModelAnimate(model, link?) | Model |
:EmitImageLabelAnimate(label, link?) | ImageLabel |
:EmitBlurAnimate(item, link?) | BlurEffect |
:EmitBloomAnimate(item, link?) | BloomEffect |
:EmitColorCorrectionAnimate(item, link?) | ColorCorrectionEffect |
:EmitAtmosphereAnimate(item, link?) | Atmosphere |
Part_Icles:EmitPartAnimate(workspace.PulsingOrb)Animate-mode behaviour splits by family. Screen-space types and ImageLabel are singleton-drop: re-calling the method while an animate clone is still alive is silently dropped — wait for the previous clone to finish (or :Disable it) before re-emitting. The 3D types (Part, Attachment, Beam, Model) are cancel-and-restart: re-calling cancels the in-flight cycle, snaps the source back to its initial CFrame, and starts a fresh cycle.
Transform / TransformModel
Section titled “Transform / TransformModel”:Transform(part) is the same call the Studio Transform button issues. Programmatic transforms are valid — useful for runtime-generated emitters or for tooling.
Part_Icles:Transform(myFreshlyCreatedPart):TransformModel(model, typeDef) is the Model-specific variant; typeDef is normally derived automatically but can be passed explicitly when transforming non-standard hierarchies.
In a shipped game, transforms are usually done at edit time in Studio, not at runtime — once an emitter is transformed, it stays that way through the place file. The runtime transform method is mostly useful in plugin development or unusual workflows.
What’s next
Section titled “What’s next”With per-type methods covered, the Texture Pinning chapter walks through :Preload and :Deload — the asset-warming methods that prevent first-emission texture stutter.