Visual Effect Component & Asset In Visual Scripting Graph

Hi there,

Hopefully simple question–is there a way to get the Visual Effect package (VFX Graph) types to show up in the Visual Scripting graphs?

All I want to do is to be able to trigger an event for the VFX graph from visual scripting. In the below example the script is going to trigger a VFX event when an animation event is triggered.

In this sample graph I can hook up the variable just as a generic Component to pass into a custom node I’ve made to trigger. This does work however it’s a bit cumbersome.

9449366--1326362--upload_2023-11-3_17-16-1.png

This does work in tandem with my custom Unit/Node. Typing in a variable name in the inspector repeatedly is, well, a bit cumbersome. I know this is a common enough workflow with visual scripting, but I’m curious for something a bit better.

It would be easier if I could just define a Graph Variable for the VFX graph asset or to link to the Visual Effect component.

9449366--1326365--upload_2023-11-3_17-38-19.png

Basically it would be great if I could define “VisualEffect” as the type in the variable here to make inspector linking much more efficient.

I have already added the VisualEffectGraph asmdefs to my node preferences in the Visual Scripting Settings but nothing appears–it seems something is missing perhaps on this package’s side of things.;

This could easily be done from a C# script of course, but I’m trying to explore options with the visual scripting specifically for this. Also not sure if this would be better asked in the visual scripting forum.

Hi @tday_magicfuel ,

what you’re looking for is in UnityEngine.VFXModule.
You can add this to your Visual Scripting Node Library to get access to VisualEffect component and its members.

Hope this helps. Please share some examples when you can. This looks interesting!

Thanks

Ah! That’s it!! Thanks. I think I added a whole bunch of other visual effect asmdefs first and just missed that one entirely.

9469694--1330784--upload_2023-11-13_16-7-3.png

Being unable to find it I had moved to a C# component that functionally did the same thing in the meantime; AnimationClips call a method directly on this component and the component in turn triggers a visual effect. Getting it hooked into visual scripting will be great for future iterations to let artists do a bit more with the visual scripting.