Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

[SOLVED] Attach field to camera

Discussion in 'Visual Effect Graph' started by Eulmiac, Mar 17, 2020.

  1. Eulmiac

    Eulmiac

    Joined:
    Mar 11, 2020
    Posts:
    10
    Hi Unity Community,
    Sorry in advance if my question seems stupid, I'm very new to all this...
    I use the vfx graph to create a static particle system onto a point cached photoscanned mesh of several million points.
    Let's say I would like to apply a force on my particles but only inside a spherical field parented to my camera. Any idea of where I should start ?
    THX a lot !
     
  2. coskuturhan

    coskuturhan

    Joined:
    Dec 9, 2016
    Posts:
    13
    Add a Sphere collider inside the Update section of your VFX graph. Create a position vec3 exposed parameter, tie that to the position of the sphere collider. On your vfx graph game object add a "vfx property binder" script component in the inspector. Drag your camera to the input of the binder and pipe it to your position property. This will make sure the sphere collider travels with the camera.
     
  3. Eulmiac

    Eulmiac

    Joined:
    Mar 11, 2020
    Posts:
    10
    Thanks for this reply !
    It seems I can get it to work, first the exposed parameter doesnt affect the collider and then in the binder I can't select the property with the little "v" and when I type it it still says that the binding is not correctly configure...

    -EDIT-

    The Position property in the vfx blackboard gives me a response in the collide block and I can select it in the Binder but still doesn't work... (Still not able to attach the sphere to the cam)
     
    Last edited: Mar 18, 2020
  4. coskuturhan

    coskuturhan

    Joined:
    Dec 9, 2016
    Posts:
    13
    Can you send the screenshot of your setup in VFX and your binding script?
     
  5. Eulmiac

    Eulmiac

    Joined:
    Mar 11, 2020
    Posts:
    10
    there we go
     

    Attached Files:

    • 06.jpg
      06.jpg
      File size:
      408.2 KB
      Views:
      386
  6. coskuturhan

    coskuturhan

    Joined:
    Dec 9, 2016
    Posts:
    13
    Try a transfrom parameter and transform VFX binder.
     
  7. Eulmiac

    Eulmiac

    Joined:
    Mar 11, 2020
    Posts:
    10
    ALL GREEN ! Thanks a lot !