Can you alter VFX graph gradients using Bolt?

EnviroDev 3 years ago updated 2 years ago 7

I would like to adjust the gradient dynamically so it will be affected by music, changing colour with loudness or something like that. I have added VFXGraph.Editor, VFXGraph.Runtime and VFXModule types but don;t see a way to add gradient options. 

Bolt Version:
Unity Version:
Scripting Backend:
.NET Version (API Compatibility Level):

Maybe try adding Gradient type

Yeah I did, it didn't expose any editable options in it's block though, just an input/output.

As far as I can tell there is no such thing as a gradient node like there is a color node. And you have to code the gradient yourself. https://docs.unity3d.com/ScriptReference/Gradient.html

I roughly translated the script to Bolt nodes but it's untested in any real use case. See if this helps: 

Interesting, thank you for that! I did discover a bit of a hacky way of getting the result I wanted, which is to just control the colour using a Multiply Color in the VFX graph and hook it up to a vector 4 in Bolt. Obviously this doesn't give you the same flexibility as a proper gradient but it's a start. I'll give the nodes you posted a try and see how it goes.

This might work better since Gradient.SetKeys requires array input technically.

Awesome, cheers TowerCrow.