FxChain: Documentation

Unlock complex, dynamic animations visually – no code, no keyframes required!

FxChain introduces a revolutionary, modular approach to animation in Unity. Build sophisticated, precisely timed animation chains visually by linking simple, powerful components directly on your GameObjects.

FxChain's unique timing-driven system allows each link of your animation chain to dynamically trigger the next, passing down timing information as it goes. This enables effortless synchronization and complex emergent behaviours with minimal setup.

Key Features:

  • Visual Node-Based Workflow: Build animation sequences by linking components in the Inspector.
  • Timing-Driven System: Easily create complex synchronization and delays.
  • Code-Free: Empower artists and designers to create intricate animations.
  • Keyframe-Free: A procedural alternative to traditional animation workflows.
  • Modular & Reusable: Combine simple components for complex results.
  • Dynamic & Flexible: Leverage randomization, external data, and procedural generation.

Dependencies

  • Unity 2021.3 LTS (minimum compatible version)
  • Unity Splines (optional) - install through the package manager
  • Unity Universal RP (optional, example scenes use URP, required to view them correctly)

Core Concepts

Understanding these core ideas is key to mastering FxChain:

  1. Animation Chains: An FxChain animation is built by linking specialized FxChain components (like Animate, Repeater, etc.) together. You add these components to GameObjects just like any other Unity component.
  2. Linking Components (Next In Chain): Each FxChain component has a Next In Chain list in its Inspector. This list defines which component(s) will execute after the current one finishes. This creates the sequence or chain of animation. You can add to this list manually or use helper buttons to quickly insert new FxChain components as children in the chain.
  3. Chain Hierarchy vs. Scene Hierarchy: The animation chain's structure (parent/child relationships defined by the Next In Chain lists) is independent of the GameObject hierarchy in the Unity Hierarchy window. Components don't need to be nested physically to be linked in the animation chain.
  4. The Chain Root: Every animation sequence starts from a designated Chain Root component. This is typically the first component in your sequence. You initiate the entire animation by triggering this root component.
  5. Timing Propagation: Each component has Initial Pause and Duration settings. Crucially, timing information flows down the chain. Child components can automatically factor in their parent's timing (e.g., wait for the parent to finish), allowing for easy synchronization without manual calculations.
  6. Editor Preview: Test your entire animation sequence directly in the Scene view using the Play button on any FxChain component, without entering Play mode.

Locating FxChain Components and Tools

  • Main Menu bar: Components and tools can be found under FxChain.
  • Hierarchy Window: Click the + Create dropdown button → FxChain for components.
  • Adding Directly to GameObjects: Click the Add Component button and search for FxChain.

Component Overviews

Animate

  • Animates Position, Rotation, and Scale towards Set Destination Transform values.
  • Supports World/Local space transformations independently.
  • Applies Randomization Ranges to destination values (useful with Repeaters).
  • Provides toggles for quick visual preview of the target transform.
  • Ability to reverse the transform - starting at the target transform and moving towards the initial transform.
  • Provides multiple easing curves for an array of parameters for fine-tuned control over movement. Some additional easing types are also included (Elastic, Back, Bounce).
  • Optionally moves towards a dynamic target object (additive, blendable motion).
  • Orients object towards a target direction, object, or its own trajectory.
  • Alternative Follow Spline Mode: Animates along a Spline Container or Line Renderer path with additional options to align to spline, look ahead, banking, easing and offset control.

Repeater

  • Spawns multiple instances of items from the Next in Chain list.
  • Controls timing per spawn (delay/duration, random/sequential).
  • Sets base spawn location/orientation via a birth transform object.
  • Optionally attaches spawns to follow the birth transform object's motion.
  • Arranges spawns: Point, Line, Arc, Mesh Vertices, Line Renderer points, Unity Splines.
  • Can orient spawns to surface normals (Mesh/Spline/Line) or aim towards a target.
  • Options to add additional randomization to individual spawn position, rotation, and scale.
  • As well as progressive incremental changes to individual spawn position, rotation, and scale.
  • Visualizes spawn locations and orientations in the Scene view.
  • Ability to Preload Spawns: Whilst building sequences spawns are created when called for but once you're happy with your build you can enable preloading to avoid the slowdown associated with instantiation.

SpriteSheet Control (SSC)

  • Animates sequences using pre-processed SpriteSheet scriptable object assets (setup via helper window).
  • Can hold multiple SpriteSheets with controls for selection and play order: All / One & Sequential / Random.
  • Ability to scrub through or preview SpriteSheet animations.
  • Controls Playspeed FPS, looping, random start frame.
  • Can automatically set Duration based on sheet length & FPS.
  • Manages sprite scale (consistent visual size) and simulates anchor points.
  • Option to apply random initial Z rotation.
  • Animates Color and Emission over time using Gradients (alpha for fades).
  • Supports inheriting materials passed down the chain.
  • Can dynamically adjust Sorting Layer/Order based on world position or camera distance.

Scaling

  • Animates object scale using a precise Animation Curve.
  • Remaps the curve's 0-1 output range to custom Min/Max scale multipliers.
  • Provides direct, focused control over scale transitions.
  • Acts as a null/passthrough link in the chain, performing no animation itself.
  • Useful for creating timing delays or branching points without adding animation behaviour.
  • Helps organize complex chain structures.

Component Shared Functionality

All FxChain components share some common UI elements in the Inspector:

  • Chain Position Indicator: A number visually showing the component's depth in the chain. Note that scenes can contain multiple chains.
  • Play Animation in Editor Button: Previews the entire animation chain starting from the Chain Root without having to enter play mode.

Next In Chain List

  • Displays the components executed immediately after this one.
  • Simply drag / drop other FxChain components to insert them as child components in the chain.
  • Additional buttons assist with removing items and altering their order.
  • View Chain Parent Button: Click to ping the parent component. This can be handy when a chain gets complex or you have multiple chains present in the current scene.
  • Provides buttons to automatically create and link new FxChain components (Animate, Repeater, etc.) as children in the chain.

Timings Section

Initial Pause: A delay before this component's animation starts.

  • Add Parent's Initial Pause (Default: On): Adds the parent's delay. Disable to potentially start simultaneously with or even before the parent.
  • Add Parent's Duration (Default: On): Waits for the parent's animation duration to complete before starting. This quickly allows sequential timing. Note that you could enable this and then set the initial pause value to a negative number to add an overlap in timings.

Duration: How long this component's own animation effect takes.

  • Add Parent's Duration: Makes this component's duration equal to its parent's. Useful for effects that should run concurrently and finish together.

Proximity Override: If enabled, the initial pause will be overridden and the animation will only start once in range of a specified object.

  • Proximity Target: The object to use in the distance check..
  • Trigger Distance: The distance at which the animation will trigger when near the Proximity Target.

Behavior Summary: A sentence summarizes the calculated timing (e.g., "Waits X seconds, then animates for Y seconds").

Other Section (Common Options)

  • Random Seed: Sets the seed for any randomization used within this component.
  • Ignore Parent Orientation: If the parent chain link has a rotation, enabling this inserts an intermediary game object that resets the orientation for this component and its children. Useful when spawned by a Repeater with rotation values.
  • Rename Includes Script Name: When renaming a script's game object, some information is automatically included, you can optionally include the component type.
    • Enabled: "[*ChainPosition*]_*ScriptName*_*CustomName*"
    • Disabled: "[*ChainPosition*]_*CustomName*"
  • Limit Decimal Places: Adjusts UI precision for sliders and fields.
  • Hide TIPS: Toggles inline help text within the Inspector.
  • Scale Slider Ranges: Adjusts the min/max limits for UI sliders.
  • Hide Movement Gizmo when Previewing: Toggles visibility of the animation path gizmo during editor preview.
  • Use Global Section Toggles: Controls the visibility behaviour of the section dropdowns.
    • Enabled: Each FxChain component will have it's own memory of sections being open or closed.
    • Disabled: Section open / closed status will be shared across all FxChain components.

External Script Trigger

Here you can trigger your own public scripts / methods using the FxChain timing system.

Audio Clip

Insert an audio file here to play it when this component's animation begins.

  • Note: This will automatically add an Audio Source component to the GameObject if it doesn't already have one.
  • Stop audio when animation completes: Uncheck if the audio clip's duration exceeds the total duration of all elements in the chain.

Video Clip

Insert a video file here to play it when this component's animation begins.

  • Note: This will automatically add an Video Player component to the GameObject if it doesn't already have one.
  • Stop video when animation completes: Uncheck if the video clip's duration exceeds the total duration of all elements in the chain.

Video Clip - Additional Setup Steps

FxChain will automatically add a Video Player component and add specified video to it but some additional manual setup steps are required to view it in the scene.

  • Add a Canvas to your scene: Hierarchy → UI → Canvas
  • Add a Raw Image as a child of the Canvas: Hierarchy → UI → RawImage
  • Create a Render Texture: Project → Create → Render Texture
  • Assign to Video Player: Assign the Render texture to the Target Texture field of the video player.
  • Assign to Raw Image: Assign the Render texture to the Texture field of the RawImage.

Video Clip file type notes: If you require alpha channel you can use the WebM format with vp8. You can convert existing video files to this format using Shutter Encoder: https://www.shutterencoder.com - Just make sure to check "Enable Alpha Channel" under Advanced Features.

Animate Component

Purpose: Moves, rotates, and scales the GameObject over time.

Set Destination Transform

  • Target Transform: Define target position, rotation, and scale values using sliders.
  • Randomization: Apply randomization ranges to position, rotation, and scale – great for creating variations when used with a Repeater.
  • Space: Choose between World or Local space transformations independently for movement and rotation. Using world position can be useful if a parent object has been scaled.
  • Preview / End at Initial Transform: (position / rotation / scale) Enabling these toggles provides a dual functionality.
    • Temporary Enable: Provides a quick way to preview the end result of the transform animation.
    • Permanent Enable: This will fully invert the transformation animation. When playing the animation back, either through the Editor or Runtime, it will start at the destination transform and end at the initial transformation.
    • Note: Be wary when reparenting the GameObject when this setting is enabled. It will cause an unexpected change to the transform; To do so safely, first disable the toggles and then re-enable after you've moved the object in the hierarchy.
  • Easing: Apply separate, nuanced motion curves using the Easing Types list (see below) or custom curves for Position, Rotation, and Scale transformations independently.

Target Object

  • Target: Specify a target GameObject using the Object Types list (see below) to move towards dynamically during the animation.
  • Additive Motion: This movement is calculated in addition to the primary Set Destination Transform animation.
  • Blending: You can smoothly blend between the Set Destination Transform motion and the Target Object motion over the component's duration.
  • Easing Controls: Uses two distinct Easing Types controls:
    • One defines the interpolation for the movement towards the target object.
    • Another defines how the blend between the Set Destination Transform and theTarget Object motion occurs over time using a blending curve.

Orientation

  • Facing Direction: Orient the GameObject's local forward (Z-axis) towards a specified target using the Object Types list.
  • Up Direction: Orient the GameObject's local up (Y-axis) towards a specified target using the Object Types list.
  • Align to Movement: Enable Orient Along Trajectory to automatically align the GameObject's forward direction to its path of movement.
  • Flip: Independent toggles allow you to flip the final Facing and Up directions if needed.

Animate Follow Spline (Alternative Mode)

Purpose: Moves and orients an object along a spline

  • Activation: Enable this mode via the button to animate the GameObject along a path instead of using the standard transform animation.
  • Path Source: Specify a GameObject that has either a Line Renderer or a Unity Spline Container component. FxChain will read the points or spline data from this source.
  • From / To: Allows you to specify a section of the spline to animate along rather than the full length.
  • Playback: Options for Looping, Reverse, and Ping Pong playback along the path.
  • Easing: Control the traversal speed along the path using a specific Easing Type or a custom curve.
  • Offset: Choose whether to Add Local Transform (adds the GameObject's initial local position/rotation as an offset to the spline path) or follow the spline path precisely.

Alignment & Orientation

  • Orient Along Path: to automatically align the GameObject's forward direction.
  • Look Ahead %: Controls how far ahead on the path (as a percentage of total path length) the object looks for orientation calculation. A value of 0 uses the current tangent; a positive value looks ahead, causing the object to anticipate turns.
  • Up Direction: Sets the object's Y-axis orientation, using the standard Object Types list.

Banking (Roll)

  • Enable Banking: to make the object realistically roll into turns.
  • Max Tilt: Limits the maximum roll angle (degrees).
  • Turning Angle Range: The sharpness of the turn is evaluated and banking is applied linearly between the lower and upper limits.
    • Lower value: When the turn angle is less than the lower value, no banking is applied (deadzone).
    • Upper value: The Max Tilt value is linearly interpolated between the lower and upper value.
  • Smooth Factor: Controls how quickly the object transitions to its calculated target bank angle. Higher values are faster/snappier; lower values are smoother/more gradual.
  • Sensitivity: Multiplier for how aggressively the object responds to path turns.
    • Values <1 mean less bank for a given turn.
    • >1 means more bank, up to the Max Tilt.

Repeater Component

Purpose: Instantiates multiple copies ("spawns") of the next component(s) in the chain.

Core Function

Creates multiple instances of the GameObject(s) holding the FxChain component(s) linked in the Repeater's Next In Chain list. Any child objects nested under the spawned component's GameObject in the Scene Hierarchy are also duplicated. Multiple Repeaters can be chained for complex, particle-system-like effects.

Spawn Timing (Overrides Standard Timings)

  • The Repeater component's main Initial Pause value acts as a delay before the spawning process begins.
  • The Initial Pause and Duration fields within this Timings section apply to each individual spawn created by the Repeater.
  • Timing Mode (Dropdown): Determines how the Initial Pause and Duration values are assigned per spawn:
    • Sequential: The value is interpolated between the Min and Max based on the spawn's index (order of creation). The first spawn gets the Min value, the last spawn gets the Max value.
    • Random: Each spawn receives a random value between the specified Min and Max.
    • Distance Based (Initial Pause Only): Calculates the Spawn's Distance from the Distance Reference Object.
      • Distance Min → Initial Pause Min
      • Distance Max → Initial Pause Max
      • Requires setting the Distance Reference Object and Distance Min/Max fields that appear when selected.
  • Min/Max Ranges: Define the range for Initial Pause and Duration per spawn used by the selected Timing Mode.
  • Subtract Own Initial Pause (Duration Only): Useful with ranged initial pauses (especially Sequential) to make all spawns finish their animations simultaneously, rather than starting simultaneously.

Spawn Configuration

  • Birth Count: Number of spawns to create (can be overridden by some arrangement modes).
  • Spawn Selection Behaviour: If multiple components are in the Next In Chain list, choose whether to cycle through them sequentially for each new spawn, or select one randomly per spawn.

Birth Transform

  • Birth Transform Object: Specify an object (Object Types list) whose transform dictates the base location/orientation for spawning.
  • Inherit Object's Motion (Attach Spawns):
    • Enabled: Spawns become children of the Birth Transform Object (or a proxy created by the Repeater) and follow its movement.
    • Disabled: Spawns only use its position/rotation at the moment of birth and do not follow it afterwards.

Arrangement

Birth Arrangement (Dropdown): Defines how spawns are positioned relative to the Birth Transform Object:

  • Point: All spawns originate at the exact same point.
  • Line: Spawns are distributed along a line (specify Width, Randomness).
  • Arc: Spawns are distributed along an arc/circle (specify Axis, Radius, Direction, Range, Randomness).
  • Mesh Points: Spawns are placed at the vertex positions of a Mesh Filter on the Birth Transform Object.
  • Line Renderer: Spawns are placed at the points of a Line Renderer on the Birth Transform Object.
  • Unity Splines: Spawns are placed along a Unity Spline Container on the Birth Transform Object.

Arrangement - Additional Options for Mesh/Line/Spline

  • Override Birth Count: If enabled, the number of spawns created matches the number of vertices/points in the source component (Mesh Filter, Line Renderer, Spline Container). If disabled for Line Renderer or Unity Splines, the specified Birth Count number of spawns will be distributed evenly along the path(s).
  • Ignore Overlapping Points (Mesh Points Only): Prevents spawning multiple instances at the exact same vertex location.
  • Orient to Normals: Aligns each spawn's forward (Z-axis) direction with the normal vector of the mesh vertex or the tangent of the line/spline at the spawn point. Disables standard Spawn Aim & Orientation below.
  • Up direction (Object Types list): Sets the up (Y-axis) orientation for spawns, used in conjunction with Orient to Normals.

Spawn Additional Transforms

Spawn Positions, Rotations and Scaling can be further manipulated on an individual basis via either the progressive or random transform values. These will apply additional offsets to the initial Position, Rotation, and Scale of each individual spawn.

Spawn Aim & Orientation

Similar to the Animate component's Orientation section, but applies initial orientation to spawns as they are created. This section is disabled if Orient to Normals is active in the arrangement settings.

  • Facing Direction: Orient each spawns' local forward (Z-axis) towards a specified target using the Object Types list.
  • Up Direction: Orient each spawns' local up (Y-axis) towards a specified target using the Object Types list.
  • Flip: Independent toggles allow you to flip the final Facing and Up directions if needed.

Scene Visualization

  • Show Spawn Reference Objects: Display temporary primitive shapes (e.g., cubes) in the Scene view to visualize where spawns will appear based on the current settings. Only visible in the Editor.
  • Show Spawn Trajectory Lines: Draw lines from the reference objects indicating their initial forward (Z - blue) and up (Y - green) directions, helpful for visualizing orientation settings. Only visible in the Editor.

Spritesheet Control Component

Purpose: Animates sequences of sprites from pre-configured Spritesheet assets.

Preparing Spritesheet Textures for Use with the Component

  • Spritesheets must first be processed into a custom FxC_SpriteSheet Scriptable Object asset. This asset holds the individual sprite frames in the correct sequence for animation.
  • Each Texture must be set up first with the following settings:
    • Texture Type: Sprite (2D and UI),
    • Sprite Mode: Multiple, and pre-sliced in Unity's Sprite Editor tool).

Setup (From Within the SSC Component)

  • Click the Setup New Spritesheet button to open a helper window.
  • The tool packages the slices into a SpriteSheet asset.
  • It provides info on sprite count and save location as well as giving the following options:
    • Maintain Aspect Ratio: Controls whether the SpriteSheet preview image scales to the full size of the helper window.
    • Insert Null Frame at Start / End: Unity's Sprite Editor tool will remove empty frames from the image but they are helpful if you need the animation to start / end without content on screen.
    • Rename: Provides the option to rename the SpriteSheet Object. If unchecked it will simply use the pre-existing name of the image.

Selection Behaviour (Multiple SpriteSheets)

The component allows you to add multiple SpriteSheets. The following options determine how sheets are chosen, especially when spawned by a Repeater.

  • ALL + Sequential: Plays all listed sheets in order.
  • ALL + Random: Plays all listed sheets in a random order.
  • ONE + Sequential: Each Repeater spawn gets the next sheet from the list in order.
  • ONE + Random: Each Repeater spawn gets a random sheet from the list.

Preview Spritesheets

  • Scrub through frames or play the sequence(s) in the Inspector.
  • Shows current sheet index, frame number, and total frames.

Spritesheet Options

  • Set Duration from Spritesheet: Automatically sets the component's Duration based on the total frame count of selected sheets and the Playspeed FPS, overriding the main Timings section Duration.
  • Playspeed FPS: Playback speed in frames per second.
  • Random Start Frame: Begin playback at a random frame within the sequence.
  • Loop Count: Number of times to repeat the entire animation sequence.
  • Set Last Frame to Null: Clears the Sprite Renderer's displayed sprite after the animation finishes.

Spritesheet Transform

  • Sprite Scale: Applies a uniform scale multiplier. The actual object scale is calculated based on this multiplier, the sprite's dimensions, and its pixels per unit, ensuring consistent visual size across different sprites.
  • Sprite Anchor Point: Simulates changing the sprite's anchor point (pivot) by adjusting the GameObject's local position relative to the selected anchor preset (e.g., Top-Left, Center, Bottom-Right), scale, and rotation.
  • Random Z Rotation: Apply a random initial Z rotation (useful when spawned by a Repeater).

Material & Color

  • Material: Choose to use the material assigned to the Sprite Renderer component or inherit a material passed down the FxChain (see External Calls).
  • Change Color Over Time: Animate _Color and _EmissionColor using Gradient editors. (Emission requires a material with an emission channel).
  • Alpha/Opacity: Use the alpha channel of the color gradients to fade the sprite.
  • SpriteRenderer Shadow Casting: Toggle shadow casting on the Sprite Renderer (material setup required).

Dynamic Sorting

  • Modify the Sprite Renderer's Sorting Layer and Order in Layer dynamically based on position.
  • Choose a Threshold Axis (X, Y, Z world position, or Distance From Camera).
  • Define different Sorting Layer/Order in Layer values for when the object is above or below the Threshold Value. Useful for ensuring correct render order for Repeater spawns at different depths or positions.

Scaling Component

Purpose: Animates the GameObject's scale using a precise curve.

  • Provides a standard Unity Curve Editor to define scale over the component's Duration.
  • Remap the curve's output (default 0-1) to a custom Min and Max scale multiplier.
  • Simple and direct control over scaling animations.

Purpose: Acts as a null or passthrough link in the chain.

  • Performs no animation itself but respects timing.
  • Useful for organizing complex chains, acting as a branching point or a delay node without adding other animation behaviour. Can link to multiple children in its Next In Chain list.

Shared Concepts Explained

Object Types List

Where you see "(uses object types list)", you can choose how the target object/position/direction is determined:

  1. User Defined: Drag any GameObject from your scene or hierarchy.
  2. Main Camera: Uses the transform of the Camera tagged MainCamera.
  3. This Object: Uses the transform of the GameObject this FxChain component is attached to.
  4. Chain Parent: Uses the transform of the FxChain component that triggered this one (its parent in the chain, not the scene hierarchy).
  5. From Chain Data: Uses an object reference passed down from the start of the chain or by a previous component (see External Calls & component options).
  6. X, Y, or Z axis: Uses the world's positive X, Y, or Z direction vector.
  7. Own Trajectory: (Available in specific contexts like Orientation) Uses the current movement direction of this GameObject.

Easing Types List

Where you see "(uses easing types list)", you can choose how the animation interpolates:

  1. Custom Easing Curve: Define the interpolation using a standard Unity Curve Editor.
  2. Elastic: Creates a springy, overshooting effect.
  3. Back: Overshoots the target slightly before settling.
  4. Bounce: Simulates bouncing off the target position before settling.

Additional Functionality for the Chain Root

Autoplay Options

  • At Start: Start the chain animation when the scene is loaded.
  • Proximity To Object: Animation will start when within range of another object. Parameters for this are configured in the Timings section, as mentioned earlier in the document.

Starting Chains from Scripts (External Calls)

You can trigger an FxChain sequence from your own C# scripts by getting a reference to the root FxChain component and calling its initiation method. When doing so, you can optionally pass in data using the ChainData class to alter the initial pause and duration of the chain root or specify a material or objects to be used by chain links. This allows for dynamic, context-aware animation playback.

Options:

  • Call - CALL_FXCHAIN_ANIMATION_TO_START_noData from a UnityEvent, Button etc
  • Call - CALL_FXCHAIN_ANIMATION_TO_START from a script, you can include the following data:
    • Initial Pause
    • Duration
    • Material (used by SpritesheetControl)
    • Target Object (used by Animate / Repeater)
    • Orient Object - Facing (used by Animate / Repeater)
    • Orient Object - Up (used by Animate / Repeater)

Notes:

  • Make sure to include the FxChain_Namespace when interacting with FxChain scripts.
  • Material: Can be accessed by the SpriteSheetControl scripts. Select the Use Material From Chain option.
  • Target OBJ:
    • Can be accessed by the Targeting section of Animate scripts. Select the From Chain Data option.
    • Can be used by Repeater as a reference object for the Birth Position. Select the From Chain Data option.
  • Orient OBJ (Facing and Up): Can be accessed by the Orientation sections of Animate and Repeater scripts. Select the From Chain Data option.

Code Example Using the ChainData Class:

public FxChain_Base chainRootScript;

private void CallStart()
{
    chainRootScript.FxChain_CALL_ANIMATION_TO_START(new ChainData()
    {
        InitialPause = new Vector2(initialPause, initialPause),
        Duration = new Vector2(duration, duration),
        Material = material,
        TargetObj = targetObj,
        OrientObj_Facing = orientObj_facing,
        OrientObj_Up = orientObj_up,
    }
});

Destroy Chain Objects when Animation Completes

Once all chain components have completed their animations destroy all relevant game objects (runtime only).

Performance: Preloading Spawns

Instantiating many GameObjects simultaneously (especially with complex hierarchies) via Repeaters can cause performance spikes. The root FxChain component has an option to Preload Spawns. This finds all Repeaters in the chain and prepares their instances ahead of time (e.g., during a loading screen). Activate the chain normally afterwards for smooth playback. This isn't always needed but it's there as an option if you do.

Workflow: Creating Prefabs

The root FxChain component includes a Create Prefab button. This handles the specific considerations needed to correctly package an entire FxChain hierarchy into a Unity Prefab, ensuring all internal references within the chain are maintained. Use this button instead of manually dragging the chain root into the Project window.

Process:

  1. Click the Create Prefab button (available only on the Chain Root) to open a dedicated window.
  2. Specify the save location and name for your prefab asset.
  3. The tool gathers all GameObjects belonging to the FxChain sequence starting from the root, including any helper objects created by components (like Ignore Parent Orientation nulls or Repeater spawn containers).
  4. It temporarily creates a new parent GameObject in the scene and arranges the collected chain objects under it.
  5. This temporary hierarchy is saved as a prefab asset using PrefabUtility.SaveAsPrefabAsset, preserving the internal FxChain links.
  6. The original chain objects and the temporary parent are removed from the scene, and an instance of the newly created prefab is placed in the scene.
  • External Parents: If any objects in your chain have parent GameObjects that are not part of the FxChain sequence itself, the tool will warn you. These external parents will not be included in the prefab, which might affect the prefab's behavior if it relied on transforms inherited from those parents.
  • Preloading: If you have used the Enable Preloading option, the structure required for preloading is saved in the prefab, but the preloaded spawn instances themselves are not. Preloading will still need to be initiated at runtime or via the button on the prefab instance.
  • Usage: The resulting asset is a standard Unity prefab and can be instantiated into your scenes as needed.

Troubleshooting

Example Scene Materials are Pink / Shadows are Missing

If you notice that materials in the FxChain example scenes appear solid pink, or if shadows seem to be missing or incorrect, it typically indicates a mismatch between the project's Render Pipeline settings and the Universal Render Pipeline (URP) materials used by the examples. FxChain is designed and tested using URP. To Resolve:

Verify Unity Version:

Ensure you are using Unity 2021.3 LTS or a newer version. FxChain relies on features and APIs available in these versions.

Check Your Project's Render Pipeline:

  1. FxChain requires the Universal Render Pipeline (URP) to be active in your project.
  2. Go to Edit → Project Settings → Graphics.
  3. Look at the Scriptable Render Pipeline Settings field.
    • If this field is empty or says "None": Your project is likely using the Built-in Render Pipeline. You will need to either install and configure URP in your existing project (refer to Unity's official URP documentation for the migration process) or test FxChain in a dedicated URP project.
    • If this field has an asset assigned: Click the asset. Check if it's a UniversalRenderPipelineAsset. If it is, URP is correctly configured. If it's a different type (e.g., HDRenderPipelineAsset), you are using a different Scriptable Render Pipeline, which is incompatible with the FxChain example materials.

Confirm with a Clean URP Project (Recommended Test):

The most reliable way to confirm that FxChain itself is working correctly and that the issue stems from project settings is to test it in a fresh URP project.

  1. Open the Unity Hub:
  2. Click the blue New project button.
  3. Select your desired Editor Version (ensure it's 2021.3 LTS or newer).
  4. Choose the 3D (URP) template (the exact name might vary slightly, e.g., "Universal Project Template"). Do not select the "3D (Core)" or "Built-in" template.
  5. Create the project.
  6. Import the FxChain asset into this new project.
  7. Open the example scenes and verify if the materials and shadows now render correctly.

If the examples work correctly in the new URP project, the issue lies within the configuration of your original project's render pipeline. If the problem persists even in a clean URP project, there might be a different issue, and you should consider reaching out for further support.

Compilation Errors After Uninstalling the Unity Splines Package

Symptom Error Message:

The type or namespace name 'Splines' does not exist in the namespace 'UnityEngine' (are you missing an assembly reference?)

Quick Fix: Unity Main Menu bar → FxChain → Check Package Defines.

Alternatively:

  1. Go to Edit → Project Settings.
  2. Select the Player category from the list on the left.
  3. In the Inspector window, find the Other Settings section and expand it if necessary.
  4. Scroll down to the Scripting Define Symbols field.
    1. Important: Ensure you are editing the symbols for the correct Build Target platform (e.g., Standalone, Android, iOS). You might need to check and remove the symbol from multiple platforms if you switch targets often.
  5. Locate and remove UNITY_SPLINES.
    1. Make sure to also delete any redundant semicolon (;) next to it.
    2. Example: Change SYMBOL_A;UNITY_SPLINES;SYMBOL_B to SYMBOL_A;SYMBOL_B.
  6. Click the Apply button at the bottom of the Inspector. Unity will recompile. Check the Console window again; the errors related to the uninstalled package should now be resolved.

Additional Info:

FxChain can optionally integrate with the Unity Splines package. To manage this, relevant code is wrapped within a custom symbol like this:

#if UNITY_SPLINES
// Code specific to the Unity Splines package
#endif

When the Splines package is installed, FxChain automatically adds a UNITY_SPLINES Scripting Define Symbol to your Project Settings, enabling this code.

When the package is uninstalled, this symbol should be automatically removed. However, sometimes Unity tries to recompile before the symbol is removed. It sees the UNITY_SPLINES symbol, tries to compile the (now missing) Splines-specific code, and fails, resulting in the error above. The automatic check might not run if compilation is already blocked by these errors.

The Scene View is Covered in FxC Icons

These can be hidden using the Scene view's Gizmos menu:

  1. Click the Gizmos button in the Scene view toolbar (top right).
  2. Find the FxChain script icon (e.g., for FxChain_Base or similar) in the list.
  3. Click the icon image next to the script name to toggle its visibility off.

Stuttering During Playback when a Repeater Generates Spawns

This can be avoided by preloading spawns from the chain root.

Using & Learning from the Provided Example Scene

This is the working example I used to build the FxChain promotional video. It came about after building several scenarios to test FxChain whilst building the software. It's quite a large scene with a lot of complexity so hopefully it won't be too overwhelming.

To look how certain pieces work I recommend first identifying which part you want to inspect and then simply copy that section into a new scene. You can also separate a certain piece from the main chain by breaking the chain - removing that item from its Parent's Next in Chain list. Then you can click the Play Animation in Editor button from a FxChain component in the freshly separated chain to get an isolated animation.

Note: Whilst the demo scene is available for all 3 render pipelines, the original version was created using the HDRP render pipeline. I recommend using that version for the best experience.

Get in Touch

  • Having issues and troubleshooting isn't helping?
  • Found a bug?
  • Have feedback? Good? Bad? Hopefully good.
  • Have a feature or functionality that you'd love to see added to FxChain?
  • Want to share something cool you've made with the tool?

Email: jamie@incendiary.design

Instagram: @incendiary.design

Reddit: incendiary-design

Youtube: youtube.com/@_incendiary

Unity Asset Store: https://assetstore.unity.com/publishers/107146/

Made Something Cool with FxChain?

Send me a DM through Instagram and I'll share it on the channel - #madewithfxchain