Additional Tips
Attaching the Trail Prefab
To properly attach the trail prefab to your character’s weapon, follow these steps:
- Attach the trail prefab under the weapon in the hierarchy, positioning it at the edge of the weapon.
- Set the Tool Handle Rotation to Local.
- Ensure the Z-axis points towards the weapon’s direction, as shown in the image below.
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:
- Create an empty
.curvetex
file or duplicate one of the existing curve textures. - Select the file and edit the curve in the Inspector.
Last updated on