- Find the weapon socket in your animation model.
- Drag the “X-WeaponTrail.prefab” into its hierarchy.
- Adjust the child gameobject “StartPoint” and “EndPoint”‘s position to match the weapon’s length.
- Now play the animation you should see a smooth trail.
Activation and Deactivation
Simply set the trail game object’s active state to activate and deactivate the trail.
you can also activate and deactivate the trail by calling the scripting API described below.
- Activation: gameObject.SetActive(true)
- Deactivation: gameObject.SetActive(false)
Please note you need to import the namespace first. Using XftWeapon;
- Activate(): Activate the trail manually.
- Deactivate(): Stop trail immediately.
- StopSmoothly(float fadeTime): Stop trail smoothly.
CURRENTLY CAN’T BE EDITED IN PLAY MODE.
- Max Frame: Indicates the length of the trail. Please note the trail length also depends on the frame rate, the higher frame rate the shorter trail you will get.
- Granularity: Indicates the granularity of the trail, the bigger the smoother.
- Fps: Indicates the update frequence of the trail.
- There is one frame lag in the trail rendering due to the unity’s rendering mechanism. I’m trying to fix it with post process rendering.