Chronos and VFXGraph

Seldemirov Pavel 10 months ago updated by Metervara 4 months ago 1

Hello! I want use my Cronus for record time in the VFXGrapn. How can I do it? How?

Chronos Version:
Unity Version:


if you just need to control the playRate of a VFX Graph you can create a new component inheriting from ComponentTimeline:

public class VFXGraphTimeline : ComponentTimeline<VisualEffect>
    public VFXGraphTimeline(Timeline timeline, VisualEffect component) : base(timeline, component) { }

    public override void AdjustProperties(float timeScale)
        component.playRate = timeScale;

then add that to the CacheComponents method of TimelineEffector:

// VFX Graph
var vfxGraphComponent = GetComponent<VisualEffect>();

if (vfxGraph == null && vfxGraphComponent != null)
	vfxGraph = new VFXGraphTimeline(timeline, vfxGraphComponent);
else if (vfxGraph != null && vfxGraphComponent == null)
	vfxGraph = null;

Then attach a Timeline Component to the GameObject with the Visual Effect

This only keeps the playRate synced with the timeline, probably won't work if reversing (negative time scale).