Search Issue Tracker
Won't Fix
Votes
0
Found in [Package]
12.0.0
Issue ID
1319090
Regression
No
[VFX] Trail with VisualEffect.Simulate doesn't handle position for sub-timesteps properly
How to reproduce:
1. Open the user's attached "BugReport1.zip" project
2. Open the "SampleScene" Scene
3. Make sure the "Gizmos" is enabled in the Game view
4. Enter Play Mode
5. Observe the Game view
Expected result: The Trail generated by the VFX is smooth like the red debug lines
Actual result: The Trail generated by the VFX is polygonal and not smooth like the red debug lines
Reproducible with: 10.4.0 (2020.3.2f1), 11.0.0 (2021.1.2f1), 12.0.0 (2021.2.0a11)
Could not test with: 7.5.3 (2019.4.23f1) - VFX not working after downgrading
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- VFX Graph Memory leak when calling the ClearPropertyBinders and AddRemoveVFXProperty
- Entering "Configure Avatar" inside the Inspector locks it
- [Render Graph Viewer] Resource list icons cropped and in inconsistent positions
- Scene View with Debug Draw Mode enabled is gray when GPU Resident Drawer is enabled
- The UI is not visible when resizing out of focus built Player window with Application.runInBackground set to false
Resolution Note:
Hello,
Thanks for this repro project, we are aware about this nonintuitive behavior, typically, it corresponds to this kind of usage :
```
User code :
vfx.SetVector3("color", red);
vfx.Simulate(0.1f, 1);
vfx.SetVector3("color", green);
vfx.Simulate(0.1f, 2);
vfx.SetVector3("color", blue);
vfx.Simulate(0.1f, 3);
What we be run actually is (because simulate is pushed on stack of event, like SendEvent) :
vfx.SetVector3("color", red);
vfx.SetVector3("color", green);
vfx.SetVector3("color", blue);
vfx.Simulate(0.1f, 1);
vfx.Simulate(0.1f, 2);
vfx.Simulate(0.1f, 3);
```
There are two ways of approaching this problem :
- Process the position interpolation (considering a Bezier curve) within the VFXGraph, this is typically the use case for a weapon trail, we will provide an appropriate sample.
- Directly control the spawn from script using direct link event to initialize context without any spawn context, however, this approach is only available since 21.2
Additionally, you can follow this feature in backlog https://portal.productboard.com/unity/1-unity-platform-rendering-visual-effects/c/101-sub-frame-interpolation which should resolve this problem more elegantly.