Skip to Content
Procedural Slash TrailAdditional Tips

Additional Tips

Attaching the Trail Prefab

To properly attach the trail prefab to your character’s weapon, follow these steps:

  1. Attach the trail prefab under the weapon in the hierarchy, positioning it at the edge of the weapon.
  2. Set the Tool Handle Rotation to Local.
  3. Ensure the Z-axis points towards the weapon’s direction, as shown in the image below. Attach Trail Prefab

Using the TrailVfxController Script

  • EnableTrail: Use this method to enable the trail effect when the swing animation starts. It automatically disables based on the TotalTrailTime property.

  • SetLifetimeModifier: Can be used to adjust the trail’s lifetime based on the animation speed.

  • SetRadiusOffset: Adjusts the trail’s radius, which can be useful for varying melee attack ranges.

  • SetTrailWidth: Adjusts the base trail width, allowing for different weapon types.

CurveTexture Tool

The CurveTexture tool allows you to create a gradient texture based on a curve, which can then be sampled in shaders using the SampleCurveTexture sub-graph. To use this tool:

  1. Create an empty .curvetex file or duplicate one of the existing curve textures.
  2. Select the file and edit the curve in the Inspector.
Last updated on