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
- Prefab override popup is cropped/positioned incorrectly when more than one display is used and a higher display Scale is set
- Opening a dropdown on a small screen results in its instant closing when mouse cursor is pressed where the dropdown is going to be opened
- Only "ArgumentNullException: Value cannot be null" is displayed instead of all the actual errors when opening a project with numerous compilation errors
- MultiColumnListView and MultiColumnTreeView do not change selection on first input when focus is set by code
- SerializedProperty.DataEquals is returning false when SerializedProperty.EqualContents return true
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.