playMaker

Author Topic: vfx graph  (Read 897 times)

calculmentor

  • Playmaker Newbie
  • *
  • Posts: 15
vfx graph
« on: July 18, 2022, 08:49:46 AM »
hi there !

I'm facing serious trouble having access to vfx graph exposed property in PM...
even the binding property script from unity seems to bind only a few properties..
what's going on ?
shader graph works like a charme with the get material float action !
but, there's no way to drive vfxgraph with PM ??
thx
calcul mentor

  *designer*

calculmentor

  • Playmaker Newbie
  • *
  • Posts: 15
Re: vfx graph
« Reply #1 on: July 18, 2022, 10:55:36 AM »
ok...
working this way with PM exemple:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.VFX;

public class VFXController_skin_particle: MonoBehaviour
{
    [SerializeField]
    private VisualEffect visualEffect;

    [SerializeField, Range(0.005f, 0.05f)]
    public float ParticlesMaxSize = 0.005f;

    //[SerializeField]
    //private Gradient meteorGradient = null;

    [SerializeField, Range(0, 300000)]
    public int ParticlesRate = 200;

    void Update()
    {
        visualEffect.SetFloat("ParticlesMaxSize", ParticlesMaxSize);
        visualEffect.SetInt("ParticlesRate", ParticlesRate);
        //visualEffect.SetGradient("MeteorGradient", meteorGradient);
    }
}
calcul mentor

  *designer*

Luceid

  • Playmaker Newbie
  • *
  • Posts: 16
Re: vfx graph
« Reply #2 on: September 05, 2023, 12:53:44 PM »
Alternatively, you can use the "call method" playmaker action and set your values very quickly! (I apologize for double posting this, but I wanted to make sure the top few google searches had the easiest method for solving this problem.)
Make sure the parameter is exposed on the graph if it isn't working for you, and make sure to use a method like "void SetFloat (string, float)" where the string is the parameter name.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: vfx graph
« Reply #3 on: September 06, 2023, 12:58:03 PM »
Hi.
its not recommended to use call method (especially if you would use it Every Frame)

as its mirroring, which is slower than dedicated actions. (which would be fine in most cases)
But build for other platforms you might need to use Linker Wizard to make sure its included in a build