### Complete VortexFX Emitter Setup Example in Lua Source: https://github.com/fancyducc/3d-particle-system/blob/main/docs/usage.md This full script provides a comprehensive example of setting up a VortexFX particle emitter. It includes module requiring, emitter instantiation, and the application of multiple properties like rate, lifetime, color, and size, demonstrating a complete functional setup. ```Lua local ReplicatedStorage = game:GetService("ReplicatedStorage") local VortexFXParticles = require(ReplicatedStorage:WaitForChild("VortexFXParticles")) local part = workspace:WaitForChild("Part") local emitter = VortexFXParticles.new(part) emitter:Create({ Rate = 15, Lifetime = NumberRange.new(2, 4), Color = ColorSequence.new(Color3.fromRGB(0, 255, 0), Color3.fromRGB(0, 0, 255)), Size = NumberSequence.new(1, 2) }) ``` -------------------------------- ### Starting VortexFX Particle Emitter in Lua Source: https://github.com/fancyducc/3d-particle-system/blob/main/docs/usage.md This snippet shows how to activate a VortexFX particle emitter using the 'emitter:Start()' method. It is the recommended way to enable the emitter as it correctly manages 'RunService' loops, ensuring proper particle emission. ```Lua emitter:Start() ``` -------------------------------- ### Controlling Emitter Lifecycle with Start/Stop/Kill in Lua Source: https://github.com/fancyducc/3d-particle-system/blob/main/docs/properties/basic-properties.md This example illustrates the recommended way to manage an emitter's state (start, stop, kill) using dedicated methods outside the `Create` function. It shows how to initialize an emitter and then control its emission and destruction programmatically. ```Lua local VortexFXParticles = require(game:GetService("ReplicatedStorage").VortexFXParticles) local emitter = VortexFXParticles.new() emitter:Create({}) emitter:Start() emitter:Stop() emitter:Kill() ``` -------------------------------- ### Requiring VortexFXParticles from ReplicatedStorage (Lua) Source: https://github.com/fancyducc/3d-particle-system/blob/main/docs/installation.md This snippet demonstrates how to require the VortexFXParticles module when it is placed in ReplicatedStorage. It first gets the ReplicatedStorage service and then uses require with WaitForChild to ensure the module is loaded before use. This setup is recommended for client-side particle usage to avoid server lag. ```Lua local ReplicatedStorage = game:GetService("ReplicatedStorage") local VortexFXParticles = require(ReplicatedStorage:WaitForChild("VortexFXParticles")) ``` -------------------------------- ### Initializing and Starting a 3D Particle Emitter in Lua Source: https://github.com/fancyducc/3d-particle-system/blob/main/README.md This Lua code snippet illustrates the fundamental steps to set up and activate a 3D particle emitter using the VortexFX system. It involves requiring the main module, instantiating a new emitter linked to a specified 'adornee' object, configuring particle properties within the 'Create' method, and finally initiating the particle emission with 'Start()'. The 'path.to.ParticleEmitter3D' placeholder must be replaced with the actual module path. ```lua local ParticleEmitter3D = require(path.to.ParticleEmitter3D) local emitter = ParticleEmitter3D.new(adornee) emitter:Create({ -- Place particle properties here }) emitter:Start() ``` -------------------------------- ### JavaScript Logic for Tabbed Content and URL Hashing Source: https://github.com/fancyducc/3d-particle-system/blob/main/site/installation.html This JavaScript snippet manages interactive tabbed content on a webpage. It iterates through tab sets, checks for pre-selected tabs based on a `__tabs` array, and updates their checked state. Additionally, it handles URL hash fragments to automatically select the corresponding tab if its `name` attribute starts with `__tabbed_`. ```JavaScript var tabs=__md_get("__tabs");if(Array.isArray(tabs))e:for(var set of document.querySelectorAll(".tabbed-set")){var tab,labels=set.querySelector(".tabbed-labels");for(tab of tabs)for(var label of labels.getElementsByTagName("label"))if(label.innerText.trim()===tab){var input=document.getElementById(label.htmlFor);input.checked=!0;continue e}} var target=document.getElementById(location.hash.slice(1));target&&target.name&&(target.checked=target.name.startsWith("__tabbed_")) ``` -------------------------------- ### Requiring 3D Particle Emitter from ReplicatedStorage (Lua) Source: https://github.com/fancyducc/3d-particle-system/blob/main/site/installation.html This Lua snippet demonstrates how to require the ParticleEmitter3D module when it is placed in ReplicatedStorage. It first gets the ReplicatedStorage service and then waits for the ParticleEmitter3D child object before requiring it, making it accessible to scripts. ```Lua local ReplicatedStorage = game:GetService("ReplicatedStorage") local ParticleEmitter3D = require(ReplicatedStorage:WaitForChild("ParticleEmitter3D")) ``` -------------------------------- ### Starting Flipbook Animation at Random Frame (Lua) Source: https://github.com/fancyducc/3d-particle-system/blob/main/docs/properties/advanced-properties.md Enables the flipbook animation to begin at a random frame instead of the first one, providing more visual variety for particle effects. The example shows how to enable this property when creating an emitter. ```Lua emitter:Create({ -- Particles start at a random frame in the flipbook Flipbook = {}, FlipbookStartRandom = true }) ``` -------------------------------- ### Starting Particle Emitter (Lua) Source: https://github.com/fancyducc/3d-particle-system/blob/main/site/usage.html This function call activates the particle emitter, causing it to begin emitting particles based on its configured properties. It is used to initiate the particle effect. ```Lua emitter:Start() ``` -------------------------------- ### Advanced Particle Color with ColorSequenceKeypoint in Lua Source: https://github.com/fancyducc/3d-particle-system/blob/main/docs/usage.md This advanced example shows how to create a complex 'ColorSequence' using 'ColorSequenceKeypoint'. This allows for multiple color stops and precise control over color transitions at different points in a particle's lifetime, enabling intricate visual effects. ```Lua emitter:Create({ Color = ColorSequence.new({ ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 235, 156)), ColorSequenceKeypoint.new(0.25, Color3.fromRGB(110, 137, 255)), ColorSequenceKeypoint.new(0.5, Color3.fromRGB(46, 255, 203)), ColorSequenceKeypoint.new(0.75, Color3.fromRGB(255, 129, 131)), ColorSequenceKeypoint.new(1, Color3.fromRGB(237, 255, 210)), }) }) ``` -------------------------------- ### Starting a Particle Emitter in Lua Source: https://github.com/fancyducc/3d-particle-system/blob/main/docs/properties/particle-commands.md This command initiates the particle emitter, causing it to begin emitting particles. It requires an initialized emitter object created using VortexFXParticles.new() and Create({}). ```Lua local VortexFXParticles = require(game:GetService("ReplicatedStorage").VortexFXParticles) local emitter = VortexFXParticles.new() emitter:Create({}) emitter:Start() ``` -------------------------------- ### Setting Particle Color with ColorSequence in Lua Source: https://github.com/fancyducc/3d-particle-system/blob/main/docs/usage.md This code demonstrates setting the 'Color' property using 'ColorSequence'. This allows particles to transition between colors over their lifetime. In this example, particles will change from red to yellow. ```Lua emitter:Create({ -- Particles transition from red to yellow Color = ColorSequence.new(Color3.fromRGB(255, 0, 0), Color3.fromRGB(255, 255, 0)) }) ``` -------------------------------- ### Setting Particle Size (Linear Growth) - Lua Source: https://github.com/fancyducc/3d-particle-system/blob/main/docs/properties/basic-properties.md This example illustrates how to make particles grow linearly in size from 1 to 2 over their lifetime using `NumberSequence.new(start, end)`. This is useful for effects like expanding smoke or explosions. ```Lua emitter:Create({ -- Particles grow in size from 1 to 2 over their lifetime Size = NumberSequence.new(1, 2) }) ``` -------------------------------- ### Defining Particle Color with ColorSequence in Lua Source: https://github.com/fancyducc/3d-particle-system/blob/main/docs/properties/basic-properties.md This example illustrates how to set the initial color of particles and create a simple color transition over their lifetime using `ColorSequence.new` with two `Color3` values. Particles will smoothly interpolate between the start and end colors. ```Lua emitter:Create({ -- Particles transition from red to yellow Color = ColorSequence.new(Color3.fromRGB(255, 0, 0), Color3.fromRGB(255, 255, 0)) }) ``` -------------------------------- ### Initializing Color Scheme Settings (JavaScript) Source: https://github.com/fancyducc/3d-particle-system/blob/main/site/installation.html This JavaScript snippet initializes and applies color scheme settings based on user preferences or stored values. It retrieves palette information from local storage and updates data-md-color-* attributes on the body element to reflect the chosen theme. ```JavaScript var media,input,key,value,palette=__md_get("__palette");if(palette&&palette.color){"(prefers-color-scheme)"===palette.color.media&&(media=matchMedia("(prefers-color-scheme: light)"),input=document.querySelector(media.matches?"[data-md-color-media='(prefers-color-scheme: light)']":"[data-md-color-media='(prefers-color-scheme: dark)']"),palette.color.media=input.getAttribute("data-md-color-media"),palette.color.scheme=input.getAttribute("data-md-color-scheme"),palette.color.primary=input.getAttribute("data-md-color-primary"),palette.color.accent=input.getAttribute("data-md-color-accent"));for([key,value]of Object.entries(palette.color))document.body.setAttribute("data-md-color-"+key,value)} ``` -------------------------------- ### Requiring 3D Particle Emitter from ServerScriptService (Lua) Source: https://github.com/fancyducc/3d-particle-system/blob/main/site/installation.html This Lua snippet shows how to require the ParticleEmitter3D module when it is placed in ServerScriptService. It retrieves the ServerScriptService and then requires the module, making it available for server-side scripts. ```Lua local ServerScriptService = game:GetService("ServerScriptService") local ParticleEmitter3D = require(ServerScriptService:WaitForChild("ParticleEmitter3D")) ``` -------------------------------- ### Setting Particle Transparency (Fade Out) - Lua Source: https://github.com/fancyducc/3d-particle-system/blob/main/docs/properties/basic-properties.md This example illustrates how to make particles gradually fade out over their entire lifetime using `NumberSequence.new(start, end)`. Particles will transition from fully opaque (0) to fully transparent (1). ```Lua emitter:Create({ -- Particles fade out over their whole lifetime Transparency = NumberSequence.new(0, 1) }) ``` -------------------------------- ### Material for MkDocs Site Configuration Source: https://github.com/fancyducc/3d-particle-system/blob/main/site/installation.html This JSON object defines the configuration for a Material for MkDocs site. It specifies various features like code annotation, copying, and selection, tab linking, header auto-hiding, and navigation options. It also configures the search worker path and provides localized strings for clipboard and search results, enhancing the user experience. ```JSON {"base": ".", "features": ["content.code.annotate", "content.code.copy", "content.code.select", "content.tabs.link", "header.autohide", "announce.dismiss", "navigation.footer", "navigation.indexes", "navigation.expand", "navigation.top", "toc.integrate", "navigation.path", "navigation.tracking", "search.highlight", "search.share", "search.suggest"], "search": "assets/javascripts/workers/search.b8dbb3d2.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}} ``` -------------------------------- ### Requiring VortexFXParticles from ServerScriptService (Lua) Source: https://github.com/fancyducc/3d-particle-system/blob/main/docs/installation.md This snippet shows how to require the VortexFXParticles module when it is located in ServerScriptService. It retrieves the ServerScriptService and then requires the module using WaitForChild. This method is suitable if the module's functionality is intended for server-side use only, though client-side usage from ReplicatedStorage is generally preferred for particles. ```Lua local ServerScriptService = game:GetService("ServerScriptService") local VortexFXParticles = require(ServerScriptService:WaitForChild("VortexFXParticles")) ``` -------------------------------- ### Setting Particle Emission Rate in Lua Source: https://github.com/fancyducc/3d-particle-system/blob/main/docs/usage.md This example shows how to set the 'Rate' property for a VortexFX emitter. The 'Rate' property controls the number of particles emitted per second. Here, it is set to emit 10 particles per second. ```Lua emitter:Create({ -- Emit 10 particles per second Rate = 10 }) ``` -------------------------------- ### Defining Pip Console Scripts in Python Source: https://github.com/fancyducc/3d-particle-system/blob/main/venv/Lib/site-packages/pip-24.0.dist-info/entry_points.txt This snippet configures console entry points for different versions of the pip command. It maps `pip`, `pip3`, and `pip3.10` to the `main` function within pip's internal command-line interface module. This allows these commands to be executed directly from the system's command line after installation, typically found in a `setup.cfg` or similar configuration file. ```Python pip = pip._internal.cli.main:main pip3 = pip._internal.cli.main:main pip3.10 = pip._internal.cli.main:main ``` -------------------------------- ### Setting Particle Color with Advanced ColorSequenceKeypoints (Lua) Source: https://github.com/fancyducc/3d-particle-system/blob/main/site/usage.html This example illustrates how to create a more complex `ColorSequence` using `ColorSequenceKeypoint` objects. Each keypoint defines a specific color at a normalized time (0 to 1) within the particle's lifetime, allowing for multi-stage color transitions. ```Lua emitter:Create({ Color = ColorSequence.new({ ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 235, 156)), ColorSequenceKeypoint.new(0.25, Color3.fromRGB(110, 137, 255)), ColorSequenceKeypoint.new(0.5, Color3.fromRGB(46, 255, 203)), ColorSequenceKeypoint.new(0.75, Color3.fromRGB(255, 129, 131)), ColorSequenceKeypoint.new(1, Color3.fromRGB(237, 255, 210)) }) }) ``` -------------------------------- ### Setting Particle Size (Sequence) - Lua Source: https://github.com/fancyducc/3d-particle-system/blob/main/docs/properties/basic-properties.md This example demonstrates how to define a complex size animation for particles over their lifetime using `NumberSequenceKeypoint`. Particles will grow and shrink according to the specified keypoints, allowing for dynamic visual effects. ```Lua emitter:Create({ -- Particles grow and shrink in size over their lifetime Size = NumberSequence.new({ NumberSequenceKeypoint.new(0, 1.25), NumberSequenceKeypoint.new(0.25, 0.4), NumberSequenceKeypoint.new(0.5, 1.3), NumberSequenceKeypoint.new(0.75, 2), NumberSequenceKeypoint.new(1, 0), }) }) ``` -------------------------------- ### Setting Particle Shape in Lua Source: https://github.com/fancyducc/3d-particle-system/blob/main/site/properties/basic-properties.html This example demonstrates how to define the visual shape of individual particles. By setting `Shape` to `Enum.PartType.Ball`, all emitted particles will appear as spheres, assuming `ReferenceObject` is not used. ```Lua emitter:Create({ -- Particles will emit as spheres Shape = Enum.PartType.Ball }) ``` -------------------------------- ### Combining Render Distance with Adaptive Particle Limits in Lua Source: https://github.com/fancyducc/3d-particle-system/blob/main/docs/properties/performance-properties.md This example shows how `RenderDistance` can be used with `MaximumParticleCount` and `AdaptiveParticleLimits`. As the camera moves further away, the maximum number of particles allowed from the emitter will be dynamically lowered, optimizing performance based on distance. ```Lua emitter:Create({ -- Particles will lower the maximum particles that can exist from this emitter the further the players camera is from the emitter RenderDistance = 200, MaximumParticleCount = 100, AdaptiveParticleLimits = true }) ``` -------------------------------- ### Initializing VortexFX Particle Emitter in Lua Source: https://github.com/fancyducc/3d-particle-system/blob/main/docs/usage.md This snippet demonstrates how to initialize a VortexFX particle emitter. It requires the 'VortexFXParticles' module from 'ReplicatedStorage' and creates a new emitter instance attached to a specified 'part' in the workspace. Users should replace 'Part' with their desired attachment point. ```Lua local ReplicatedStorage = game:GetService("ReplicatedStorage") local VortexFXParticles = require(ReplicatedStorage:WaitForChild("VortexFXParticles")) local part = workspace:WaitForChild("Part") -- Replace this line in your game where you want the particles to emit from, this can be either an attachment or a basepart local emitter = VortexFXParticles.new(part) emitter:Create({ -- Properties here }) ``` -------------------------------- ### Defining OnSpawn Function in Lua Source: https://github.com/fancyducc/3d-particle-system/blob/main/docs/properties/event-functions.md This function is called when a particle is first created or spawned. The example demonstrates how to define an `OnSpawn` function within the `emitter:Create` method to print a message when a particle spawns. ```Lua emitter:Create({ -- Print "particle spawned" when called OnSpawn = function(particle) print("particle spawned") end }) ``` -------------------------------- ### Setting Particle Material in Lua Source: https://github.com/fancyducc/3d-particle-system/blob/main/docs/properties/basic-properties.md This example demonstrates how to apply a material to particles, affecting their visual appearance and properties like reflectivity or glow. The `Material` property uses `Enum.Material` to define the particle's surface. ```Lua emitter:Create({ -- Particles will glow Material = Enum.Material.Neon }) ``` -------------------------------- ### Defining ConstantFunction in Lua Source: https://github.com/fancyducc/3d-particle-system/blob/main/docs/properties/event-functions.md This function is called every frame prior to the frame being rendered. The example demonstrates how to implement `ConstantFunction` within `emitter:Create` to continuously print the particle's position each frame. ```Lua emitter:Create({ -- Print the particles position every frame ConstantFunction = function(particle) print(tostring(particle.Position)) end }) ``` -------------------------------- ### Configuring Particle Initial Rotation with Vector3 in Lua Source: https://github.com/fancyducc/3d-particle-system/blob/main/docs/properties/basic-properties.md This example demonstrates how to set the initial rotation of particles using a `Vector3` value. Each component of the `Vector3` corresponds to the rotation angle around the X, Y, and Z axes, respectively. ```Lua emitter:Create({ -- Particles start with a 45 degree rotation on the Y-axis and Z-axis Rotation = Vector3.new(0, 45, 45) }) ``` -------------------------------- ### Setting Particle Emission Direction in Lua Source: https://github.com/fancyducc/3d-particle-system/blob/main/docs/properties/basic-properties.md This example demonstrates how to specify the initial emission direction for particles using `Enum.NormalId`. This property controls the general direction particles will travel when spawned from the emitter. ```Lua emitter:Create({ -- Particles will emit right from the emitter EmissionDirection = Enum.NormalId.Right }) ``` -------------------------------- ### Preserving Original Model Transparencies (Lua) Source: https://github.com/fancyducc/3d-particle-system/blob/main/docs/properties/advanced-properties.md Determines if the transparency settings of parts within an emitted model should be preserved as they were when the model was initially added. By default, transparencies might be altered. The example shows how to enable this preservation. ```Lua emitter:Create({ KeepOriginalTransparencies = true -- Original transparencies are kept from the original model }) ``` -------------------------------- ### Manually Configuring Particle Light Properties (Deprecated) (Lua) Source: https://github.com/fancyducc/3d-particle-system/blob/main/site/properties/light.html This deprecated example demonstrates how to manually control various light properties of particles, such as brightness, color, range, and shadows, by setting `ManualLightProperties` to true. It provides fine-grained control over the emitted light's characteristics. ```Lua emitter:Create({ EmitLight = true, ManualLightProperties = true, LightBrightness = 10, LightColor = Color3.fromRGB(255, 255, 255), LightRange = 15, LightShadows = true }) ``` -------------------------------- ### Setting Instability Intensity - Lua Source: https://github.com/fancyducc/3d-particle-system/blob/main/site/properties/instability.html This example shows how to configure both 'Instability' and 'InstabilityIntensity'. 'InstabilityIntensity' controls the rate at which the 'Instability' jitter occurs per second, leading to more intense and fast-paced particle movement. ```Lua emitter:Create({ -- Particles will have intense fast-paced movement Instability = 2, InstabilityIntensity = 12 }) ``` -------------------------------- ### Configuring Particle Lifetime with NumberRange in Lua Source: https://github.com/fancyducc/3d-particle-system/blob/main/docs/properties/basic-properties.md This example shows how to set the duration particles exist before disappearing using a `NumberRange`. Particles will have a random lifetime within the specified minimum and maximum values. ```Lua emitter:Create({ -- Particles live between 3 to 5 seconds Lifetime = NumberRange.new(3, 5) }) ``` -------------------------------- ### Setting Instability Smoothness - Lua Source: https://github.com/fancyducc/3d-particle-system/blob/main/site/properties/instability.html This example illustrates setting 'Instability' and 'InstabilitySmoothness'. 'InstabilitySmoothness' (though currently non-functional) is intended to control the fluidity of the instability movement, with higher values resulting in smoother, more flowy motion. ```Lua emitter:Create({ -- Particles will have smoother movements and look flowy Instability = 2, InstabilitySmoothness = 1 }) ``` -------------------------------- ### Setting Particle Transparency (Flicker) - Lua Source: https://github.com/fancyducc/3d-particle-system/blob/main/docs/properties/basic-properties.md This example demonstrates how to create a flickering transparency effect for particles over their lifetime using `NumberSequenceKeypoint`. Particles will rapidly change between opaque and transparent states, suitable for effects like sparks or glitches. ```Lua emitter:Create({ -- Particles flicker on and off over their whole lifetime Transparency = NumberSequence.new({ NumberSequenceKeypoint.new(0, 0), NumberSequenceKeypoint.new(0.25, 1), NumberSequenceKeypoint.new(0.5, 0), NumberSequenceKeypoint.new(0.75, 1), NumberSequenceKeypoint.new(1, 0), }) }) ``` -------------------------------- ### Setting Particle Light Emission Brightness (Lua) Source: https://github.com/fancyducc/3d-particle-system/blob/main/site/properties/light.html This example shows how to make particles emit light and control its brightness using `LightEmission`. Setting `EmitLight` to true enables light emission, and `LightEmission` (recommended between 0 and 1) adjusts the intensity of the emitted light, making particles appear brighter. ```Lua emitter:Create({ -- Particles are bright EmitLight = true, LightEmission = 0.75 }) ``` -------------------------------- ### Setting Particle Emission Speed (Range) - Lua Source: https://github.com/fancyducc/3d-particle-system/blob/main/docs/properties/basic-properties.md This example shows how to set the emission speed of particles to a random value within a specified range using `NumberRange.new(min, max)`. Particles will be emitted with a speed between 5 and 10 units. ```Lua emitter:Create({ -- Particles emit with a random speed between 5 and 10 Speed = NumberRange.new(5, 10) }) ``` -------------------------------- ### Setting Particle Size with Complex NumberSequenceKeypoints in Lua Source: https://github.com/fancyducc/3d-particle-system/blob/main/site/properties/basic-properties.html This example illustrates advanced particle size control using `NumberSequenceKeypoint` objects. It allows defining specific size values at different points in a particle's lifetime, enabling complex growth and shrinking patterns. ```Lua emitter:Create({ -- Particles grow and shrink in size over their lifetime Size = NumberSequence.new({ NumberSequenceKeypoint.new(0, 1.25), NumberSequenceKeypoint.new(0.25, 0.4), NumberSequenceKeypoint.new(0.5, 1.3), NumberSequenceKeypoint.new(0.75, 2), NumberSequenceKeypoint.new(1, 0) }) }) ``` -------------------------------- ### Setting Particle Lifetime with NumberRange in Lua Source: https://github.com/fancyducc/3d-particle-system/blob/main/site/properties/basic-properties.html This example shows how to define a varied lifetime for particles using `NumberRange.new()`. Particles created by this emitter will exist for a random duration between 3 and 5 seconds before disappearing. ```Lua emitter:Create({ -- Particles live between 3 to 5 seconds Lifetime = NumberRange.new(3, 5) }) ``` -------------------------------- ### Combining Aggressive Culling and Focus Awareness for Particle Emitters in Lua Source: https://github.com/fancyducc/3d-particle-system/blob/main/docs/properties/performance-properties.md This example demonstrates combining `AggressiveCullingEnabled` and `FocusAware` properties. Particles will stop updating when the player looks away or when the Roblox client loses focus, providing a dual optimization strategy. ```Lua emitter:Create({ -- Particles will stop updating when a player focuses on a different application AggressiveCullingEnabled = true, FocusAware = true }) ``` -------------------------------- ### Setting Maximum and Minimum Particle Counts in Lua Source: https://github.com/fancyducc/3d-particle-system/blob/main/docs/properties/performance-properties.md These properties define the upper and lower bounds for the number of particles that can be emitted from an emitter simultaneously. They are particularly useful when combined with `RenderDistance` and `AdaptiveParticleLimits` for dynamic optimization. The example sets a maximum of 100 and a minimum of 5 particles. ```Lua emitter:Create({ -- Particles will stop emitting when a player looks away. MaximumParticleCount = 100 MinimumParticleCount = 5 }) ``` -------------------------------- ### Setting Particle Emission Rate in Lua Source: https://github.com/fancyducc/3d-particle-system/blob/main/site/usage.html This example shows how to configure the 'Rate' property of the particle emitter. The 'Rate' property determines the number of particles emitted per second. Here, it's set to '10', meaning 10 particles will be generated every second. ```Lua emitter:Create({ Rate = 10 -- Emit 10 particles per second }) ``` -------------------------------- ### Configuring Single Particle Attractor (Lua) Source: https://github.com/fancyducc/3d-particle-system/blob/main/docs/properties/advanced-properties.md Defines a single instance that will pull particles towards it, acting like a positive magnetic pole. This property allows for dynamic particle behavior. The example shows how to assign a specific game.Workspace object as the attractor. ```Lua emitter:Create({ Attractor = game.Workspace.Attractor -- This object will pull particles in }) ``` -------------------------------- ### Setting Base Instability - Lua Source: https://github.com/fancyducc/3d-particle-system/blob/main/site/properties/instability.html This example demonstrates how to set the 'Instability' property when creating a particle emitter. 'Instability' introduces a base level of randomness to particle positions, causing them to jitter slightly in 3D space by a specified amount (in studs). ```Lua emitter:Create({ -- Particles will jitter slightly Instability = 2 }) ``` -------------------------------- ### Linking Sound to Particle System with AudioReactive (Lua) Source: https://github.com/fancyducc/3d-particle-system/blob/main/site/properties/audio.html This property links a sound object to the particle system, enabling particles to react to the sound's playback. It is a prerequisite for any other audio influence properties to function. The example demonstrates how to assign a sound instance to the `AudioReactive` property when creating the emitter. ```Lua local sound = workspace:WaitForChild("Sound") -- Replace with a sound instance emitter:Create({ -- Particles will react to this sound but not without any of the influences below AudioReactive = sound }) ``` -------------------------------- ### Defining OnSpawn Function - Lua Source: https://github.com/fancyducc/3d-particle-system/blob/main/site/properties/event-functions.html This function is invoked immediately when a particle is created. It allows for custom actions to be performed at the particle's inception, such as logging or initializing particle-specific properties. The example demonstrates printing a message to the console upon particle creation. ```Lua emitter:Create({ -- Print "particle spawned" when called OnSpawn = function(particle) print("particle spawned") end }) ``` -------------------------------- ### Combining Multiple Particle Properties in Lua Source: https://github.com/fancyducc/3d-particle-system/blob/main/docs/usage.md This snippet demonstrates how to combine several particle properties within a single 'Create' call. It sets the emission 'Rate', 'Lifetime' range, 'Color' sequence, and 'Size' sequence, allowing for comprehensive customization of particle behavior and appearance. ```Lua emitter:Create({ Rate = 15, Lifetime = NumberRange.new(2, 4), Color = ColorSequence.new(Color3.fromRGB(0, 255, 0), Color3.fromRGB(0, 0, 255)), Size = NumberSequence.new(1, 2) }) ``` -------------------------------- ### Defining OnBeat Callback in Lua Source: https://github.com/fancyducc/3d-particle-system/blob/main/docs/properties/audio.md This property allows defining a function that executes every time the system detects a beat, based on the `BeatDetectionThreshold`. It provides a way to trigger custom actions or particle behaviors synchronized with the music. The example demonstrates printing 'Beat' to the console whenever a beat is detected. ```Lua emitter:Create({ -- Prints "Beat" everytime a beat happens AudioReactive = sound, OnBeat = function(particle) print("Beat") end }) ``` -------------------------------- ### Setting Up the 3D Particle Emitter in Lua Source: https://github.com/fancyducc/3d-particle-system/blob/main/site/usage.html This snippet demonstrates how to initialize the 3D Particle Emitter. It requires the 'ParticleEmitter3D' module from 'ReplicatedStorage' and creates a new emitter instance attached to a specified 'part' in the workspace. Users should replace 'Part' with their desired attachment point. ```Lua local ReplicatedStorage = game:GetService("ReplicatedStorage") local ParticleEmitter3D = require(ReplicatedStorage:WaitForChild("ParticleEmitter3D")) local part = workspace:WaitForChild("Part") -- Replace this line in your game where you want the particles to emit from, this can be either an attachment or a basepart local emitter = ParticleEmitter3D.new(part) emitter:Create({ -- Properties here }) ``` -------------------------------- ### Setting Particle Color with ColorSequence in Lua Source: https://github.com/fancyducc/3d-particle-system/blob/main/site/properties/basic-properties.html This example shows how to define a particle's color using ColorSequence.new, allowing the particle's color to smoothly transition between two specified Color3 values over its lifetime. This is useful for creating dynamic visual effects like fading or color-changing particles. ```Lua emitter:Create({ -- Particles transition from red to yellow Color = ColorSequence.new(Color3.fromRGB(255, 0, 0), Color3.fromRGB(255, 255, 0)) }) ``` -------------------------------- ### Initializing Tabbed Content and Hash Navigation in JavaScript Source: https://github.com/fancyducc/3d-particle-system/blob/main/site/templatelist.html This JavaScript snippet handles the initialization of tabbed content and navigation based on URL hashes. It iterates through tabbed sets, checks for pre-selected tabs from a `__tabs` array, and ensures the correct tab is active. Additionally, it manages deep linking to specific elements identified by URL hash, setting their `checked` property if they are part of a tabbed interface. ```JavaScript var tabs=__md_get("__tabs");if(Array.isArray(tabs))e:for(var set of document.querySelectorAll(".tabbed-set")){var tab,labels=set.querySelector(".tabbed-labels");for(tab of tabs)for(var label of labels.getElementsByTagName("label"))if(label.innerText.trim()===tab){var input=document.getElementById(label.htmlFor);input.checked=!0;continue e}} var target=document.getElementById(location.hash.slice(1));target&&target.name&&(target.checked=target.name.startsWith("__tabbed_")) ``` -------------------------------- ### Setting Particle Emission Rate in Lua Source: https://github.com/fancyducc/3d-particle-system/blob/main/site/properties/basic-properties.html This example illustrates how to control the number of particles emitted per second. Setting `Rate` to `10` will cause the emitter to produce 10 particles every second. High rates should be used cautiously to avoid performance issues. ```Lua emitter:Create({ -- Emit 10 particles per second Rate = 10 }) ``` -------------------------------- ### Defining OnBeat Function for Audio Reaction in Lua Source: https://github.com/fancyducc/3d-particle-system/blob/main/docs/properties/event-functions.md This function is played every beat or hit detected by the system, using `BeatDetectionThreshold` as its source. The example demonstrates how to set up `AudioReactive` and define an `OnBeat` function within `emitter:Create` to print 'Beat' whenever a beat is detected. ```Lua emitter:Create({ -- Prints "Beat" everytime a beat happens AudioReactive = sound, OnBeat = function(particle) print("Beat") end }) ``` -------------------------------- ### Initializing MkDocs Theme Palette (JavaScript) Source: https://github.com/fancyducc/3d-particle-system/blob/main/site/prerequisites/partcache.html This JavaScript snippet initializes the site's color palette based on user preferences or stored settings. It retrieves palette data from local storage using `__md_get`, checks for `prefers-color-scheme` media queries, and applies the selected color scheme (light/dark) and accent colors to the document body attributes. This ensures consistent theme application across sessions. ```JavaScript var media,input,key,value,palette=__md_get("__palette");if(palette&&palette.color){"(prefers-color-scheme)"===palette.color.media&&(media=matchMedia("(prefers-color-scheme: light)"),input=document.querySelector(media.matches?"[data-md-color-media='(prefers-color-scheme: light)']":"[data-md-color-media='(prefers-color-scheme: dark)']"),palette.color.media=input.getAttribute("data-md-color-media"),palette.color.scheme=input.getAttribute("data-md-color-scheme"),palette.color.primary=input.getAttribute("data-md-color-primary"),palette.color.accent=input.getAttribute("data-md-color-accent"));for([key,value]of Object.entries(palette.color))document.body.setAttribute("data-md-color-"+key,value)} ``` -------------------------------- ### Material for MkDocs Site Configuration in JSON Source: https://github.com/fancyducc/3d-particle-system/blob/main/site/getting-started.html This JSON object defines the comprehensive configuration for a Material for MkDocs documentation site. It specifies the base directory, enables various features such as code annotation, copying, and selection, tab linking, header auto-hiding, and different navigation options. It also configures the search worker and provides localized translations for common UI elements. ```JSON {"base": ".", "features": ["content.code.annotate", "content.code.copy", "content.code.select", "content.tabs.link", "header.autohide", "announce.dismiss", "navigation.footer", "navigation.indexes", "navigation.expand", "navigation.top", "toc.integrate", "navigation.path", "navigation.tracking", "search.highlight", "search.share", "search.suggest"], "search": "assets/javascripts/workers/search.b8dbb3d2.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}} ``` -------------------------------- ### Setting Particle Storage Folder (Lua) Source: https://github.com/fancyducc/3d-particle-system/blob/main/site/properties/advanced-properties.html This property determines the specific folder within the game hierarchy where particles will be stored. The example illustrates how to assign a `ParticleFolder` using `emitter:Create()`, organizing particles under a designated folder like 'Particles' in the workspace. ```Lua emitter:Create({ -- Particles will be organized under this folder ParticleFolder = game.Workspace("Particles") }) ``` -------------------------------- ### Changing Particle Color with Audio Loudness (Lua) Source: https://github.com/fancyducc/3d-particle-system/blob/main/site/properties/audio.html This property allows the color of the particles to change dynamically based on the loudness of the linked audio. It requires `AudioReactive` to be set. The example shows how to enable color influence by setting `AudioInfluencedColor` to `true`. ```Lua emitter:Create({ -- Particles change color based on audio loudness AudioReactive = sound, AudioInfluencedColor = true }) ``` -------------------------------- ### Destroying VortexFX Particle Emitter in Lua Source: https://github.com/fancyducc/3d-particle-system/blob/main/docs/usage.md This snippet explains how to destroy a VortexFX particle emitter and remove all associated particles using the 'emitter:Kill()' method. While it stops emission and clears particles, the emitter object can still be restarted with 'emitter:Start()' if needed. ```Lua emitter:Kill() ``` -------------------------------- ### Configuring Multiple Particle Attractors (Lua) Source: https://github.com/fancyducc/3d-particle-system/blob/main/docs/properties/advanced-properties.md Defines a table of instances that will pull particles towards them, acting like multiple positive magnetic poles. This property allows for dynamic particle behavior with multiple attraction points. The example shows how to assign a table of game.Workspace objects as attractors. ```Lua emitter:Create({ Attractor = {game.Workspace.Attractor1, game.Workspace.Attractor2, game.Workspace.Attractor3} -- These objects will pull particles in }) ``` -------------------------------- ### Configuring Single Particle Repulsor (Lua) Source: https://github.com/fancyducc/3d-particle-system/blob/main/docs/properties/advanced-properties.md Defines a single instance that will push particles away from it, acting like a positive magnetic pole repelling another positive pole. This property allows for dynamic particle behavior. The example shows how to assign a specific game.Workspace object as the repulsor. ```Lua emitter:Create({ Repulsor = game.Workspace.Repulsor -- This object will push particles away }) ``` -------------------------------- ### Enabling Adaptive Particle Limits with Render Distance in Lua Source: https://github.com/fancyducc/3d-particle-system/blob/main/docs/properties/performance-properties.md This property dynamically lowers the maximum number of particles an emitter can have as the player's camera moves further away. This example demonstrates its use with `RenderDistance` and `MaximumParticleCount` to achieve performance optimization by reducing particle density at greater distances. ```Lua emitter:Create({ -- Particles will lower the maximum particles that can exist from this emitter the further the players camera is from the emitter RenderDistance = 200, MaximumParticleCount = 100, AdaptiveParticleLimits = true }) ``` -------------------------------- ### Setting ReferenceObject for Particle Emitter (Lua) Source: https://github.com/fancyducc/3d-particle-system/blob/main/site/properties/advanced-properties.html This property specifies a part or model that particles will reference during their lifetime, useful for effects that follow a specific object. The example demonstrates how to set a `ReferenceObject` for particles using the `emitter:Create()` method, making them follow a designated part in the workspace. ```Lua local referencePart = workspace:WaitForChild("Part") -- Replace with a part or model emitter:Create({ -- Particles will reference this object ReferenceObject = referencePart }) ``` -------------------------------- ### Initializing Documentation Theme Color Palette in JavaScript Source: https://github.com/fancyducc/3d-particle-system/blob/main/site/properties/basic-properties.html This JavaScript snippet initializes the documentation's color palette based on user preferences or stored settings. It checks for a saved palette, determines the preferred color scheme (light/dark), and applies the corresponding color attributes to the document body, ensuring the theme is correctly rendered. ```JavaScript var media,input,key,value,palette=__md_get("__palette");if(palette&&palette.color){"(prefers-color-scheme)"===palette.color.media&&(media=matchMedia("(prefers-color-scheme: light)"),input=document.querySelector(media.matches?"[data-md-color-media='(prefers-color-scheme: light)']":"[data-md-color-media='(prefers-color-scheme: dark)']"),palette.color.media=input.getAttribute("data-md-color-media"),palette.color.scheme=input.getAttribute("data-md-color-scheme"),palette.color.primary=input.getAttribute("data-md-color-primary"),palette.color.accent=input.getAttribute("data-md-color-accent"));for([key,value]of Object.entries(palette.color))document.body.setAttribute("data-md-color-"+key,value)} ``` -------------------------------- ### Defining Particle Trajectory with TrajectorialVertices (Lua) Source: https://github.com/fancyducc/3d-particle-system/blob/main/site/properties/trajectory.html This example demonstrates how to use the `TrajectorialVertices` property to define a looping path for particles. When multiple `Vector3` points are provided, particles will move sequentially from the first to the last, then loop back to the first. This property requires a table containing at least one `Vector3` object. ```Lua emitter:Create({ -- Particles will follow these points in space TrajectorialVertices = { Vector3.new(0, 0, 0), Vector3.new(10, 0, 0), Vector3.new(10, 10, 0), Vector3.new(0, 10, 0) } }) ``` -------------------------------- ### Initializing Documentation Utilities - JavaScript Source: https://github.com/fancyducc/3d-particle-system/blob/main/site/properties/instability.html This JavaScript snippet defines core utility functions for the documentation site, including methods for managing URL scope, generating hashes, and interacting with local storage to persist user preferences or site state. ```JavaScript __md_scope=new URL("..",location),__md_hash=e=>[...e].reduce((e,_)=>(e<<5)-e+_.charCodeAt(0),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}} ``` -------------------------------- ### Applying Drag to Particles in Lua Source: https://github.com/fancyducc/3d-particle-system/blob/main/site/properties/basic-properties.html This example demonstrates how to apply a drag force to particles, causing them to gradually slow down over time. The Drag property, set to a value like 0.5, simulates air resistance, which is essential for realistic particle movement in environments like smoke or dust. ```Lua emitter:Create({ -- Particles will gradually slow down as they move Drag = 0.5 }) ``` -------------------------------- ### Configuring Beat Detection Threshold in Lua Source: https://github.com/fancyducc/3d-particle-system/blob/main/docs/properties/audio.md This property controls the required audio loudness change for a beat to be detected. It defines how sensitive the system is to changes in audio volume, triggering a beat when the threshold is met within a short timeframe. The example sets the threshold to 25, meaning the audio loudness must increase by 25 units within 2 frames for a beat to be registered. ```Lua emitter:Create({ -- Audio loudness must increase by 25 within 2 frames to be considered a beat AudioReactive = sound, BeatDetectionThreshold = 25, }) ``` -------------------------------- ### Applying Dynamic Color Scheme from Local Storage (JavaScript) Source: https://github.com/fancyducc/3d-particle-system/blob/main/site/templatelist.html This JavaScript code retrieves color palette settings from local storage using the __md_get utility. It dynamically adjusts the document's color scheme based on user preferences (e.g., light/dark mode) by querying matchMedia and updating data-md-color-* attributes on the element. This ensures the UI theme reflects the stored or preferred settings. ```JavaScript var media,input,key,value,palette=__md_get("__palette");if(palette&&palette.color){"(prefers-color-scheme)"===palette.color.media&&(media=matchMedia("(prefers-color-scheme: light)"),input=document.querySelector(media.matches?"[data-md-color-media='(prefers-color-scheme: light)']":"[data-md-color-media='(prefers-color-scheme: dark)']"),palette.color.media=input.getAttribute("data-md-color-media"),palette.color.scheme=input.getAttribute("data-md-color-scheme"),palette.color.primary=input.getAttribute("data-md-color-primary"),palette.color.accent=input.getAttribute("data-md-color-accent"));for([key,value]of Object.entries(palette.color))document.body.setAttribute("data-md-color-"+key,value)} ``` -------------------------------- ### Configuring Solid Particle Behavior on Collision (Lua) Source: https://github.com/fancyducc/3d-particle-system/blob/main/site/properties/collision.html This example shows how to make particles behave as solid objects upon collision by setting `ParticlesAreSolid` to `true`. When this property is true, particles will bounce off surfaces; otherwise, they will spread out around the hit object. It requires `EnableCollision` to also be true for effect. ```Lua emitter:Create({ -- Particles will bounce on collision EnableCollision = true, ParticlesAreSolid = true }) ``` -------------------------------- ### Applying Color Scheme from Local Storage (JavaScript) Source: https://github.com/fancyducc/3d-particle-system/blob/main/site/getting-started.html This JavaScript snippet retrieves color palette preferences from local storage using the `__md_get` utility. It checks for `(prefers-color-scheme)` media queries to determine the current theme (light/dark) and updates the `document.body` attributes (`data-md-color-key`) based on the stored or detected color scheme, ensuring consistent styling. ```JavaScript var media,input,key,value,palette=__md_get("__palette");if(palette&&palette.color){"(prefers-color-scheme)"===palette.color.media&&(media=matchMedia("(prefers-color-scheme: light)"),input=document.querySelector(media.matches?"[data-md-color-media='(prefers-color-scheme: light)']":"[data-md-color-media='(prefers-color-scheme: dark)']"),palette.color.media=input.getAttribute("data-md-color-media"),palette.color.scheme=input.getAttribute("data-md-color-scheme"),palette.color.primary=input.getAttribute("data-md-color-primary"),palette.color.accent=input.getAttribute("data-md-color-accent"));for([key,value]of Object.entries(palette.color))document.body.setAttribute("data-md-color-"+key,value)} ``` -------------------------------- ### Configuring Flipbook Frame Rate (Lua) Source: https://github.com/fancyducc/3d-particle-system/blob/main/docs/properties/advanced-properties.md Sets the animation frame rate for flipbook particles. This can be a fixed number or a NumberRange for randomization. Note that OneShot mode ignores this setting as it adjusts the frame rate to particle lifetime. The example demonstrates setting a random frame rate between 1 and 4 frames per second. ```Lua emitter:Create({ -- Particles will cycle through frames at a random frame rate between 1 and 4 frames per second Flipbook = {}, FlipbookFrameRate = NumberRange.new(1, 4) }) ``` -------------------------------- ### Getting Active Particle Count in Lua Source: https://github.com/fancyducc/3d-particle-system/blob/main/docs/properties/particle-commands.md This function returns the total number of particles currently active and being updated across the entire system. It provides a real-time count of rendered particles. ```Lua -- Will return the amount of particles currently active in the entire world local VortexFXParticles = require(game:GetService("ReplicatedStorage").VortexFXParticles) local particleCount = VortexFXParticles:GetActiveParticlesCount() ``` -------------------------------- ### Configuring Multiple Particle Repulsors (Lua) Source: https://github.com/fancyducc/3d-particle-system/blob/main/docs/properties/advanced-properties.md Defines a table of instances that will push particles away from them, acting like multiple positive magnetic poles repelling other positive poles. This property allows for dynamic particle behavior with multiple repulsion points. The example shows how to assign a table of game.Workspace objects as repulsors. ```Lua emitter:Create({ Repulsor = {game.Workspace.Repulsor1, game.Workspace.Repulsor2, game.Workspace.Repulsor3} -- These objects will push particles away }) ``` -------------------------------- ### Initializing MD Scope and Local Storage Utilities (JavaScript) Source: https://github.com/fancyducc/3d-particle-system/blob/main/site/getting-started.html This snippet initializes utility functions for managing application scope, hashing, and interacting with local storage. It defines `__md_scope` for base URL, `__md_hash` for string hashing, `__md_get` to retrieve JSON data from local storage, and `__md_set` to store JSON data, including error handling for storage operations. ```JavaScript __md_scope=new URL(".",location),__md_hash=e=>[...e].reduce((e,_)=>(e<<5)-e+_.charCodeAt(0),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}} ``` -------------------------------- ### Initializing Tabbed Content from Storage/URL (JavaScript) Source: https://github.com/fancyducc/3d-particle-system/blob/main/site/properties/basic-properties.html This JavaScript snippet manages the state of tabbed content sections on a webpage. It attempts to activate a specific tab either by retrieving its name from a "__tabs" variable (likely from local storage or a global configuration) or by checking the URL's hash. This ensures that the correct tab is displayed upon page load or navigation. ```JavaScript var tabs=__md_get("__tabs");if(Array.isArray(tabs))e:for(var set of document.querySelectorAll(".tabbed-set")){var tab,labels=set.querySelector(".tabbed-labels");for(tab of tabs)for(var label of labels.getElementsByTagName("label"))if(label.innerText.trim()===tab){var input=document.getElementById(label.htmlFor);input.checked=!0;continue e}} var target=document.getElementById(location.hash.slice(1));target&&target.name&&(target.checked=target.name.startsWith("__tabbed_")) ```