Search Unity

struggling to set up the initialize block with local/world position

Discussion in 'Visual Effect Graph' started by Thibault_potier, May 13, 2021.

  1. Thibault_potier

    Thibault_potier

    Joined:
    May 4, 2021
    Posts:
    46
    Hi
    I'm want to make an extinguisher prefab, and I'm struggling with vfx graph to shoot the water from my gameObject. I must misunderstand some of the concept here.

    I'm following this tutorial that show how to make a flamethrower, but I do not seems to have the same version of vfx graph (I must use additionnal block to convert position from local to world space per example).

    My problem is that when I move my gameobject in the scene, my particule doesn't keep shooting straigh from it. (I want to shoot along the gameobject.transform.forward axis. here depending of the gameobject world position, it does'nt shoot in the same direction. I think the problem come from the "set velocity" part.)

    Also when parenting the gameobject holding the visual effect with another gameObject, its transform get wrong. I got an offset on the y axis





    here is my graph :



    What am I doing wrong ? How can i make my particule system shoot from my gameobject in the gameobject toward direction ?
     
  2. VladVNeykov

    VladVNeykov

    Unity Technologies

    Joined:
    Sep 16, 2016
    Posts:
    550
    Hi @Thibault_potier ,

    This might help explain the world/local set-up:


    Can you check your setup and see if it adheres to these? The final result is something like this:


    Hard to tell with this, you could have a number of rotations and offsets, but hopefully the issue you are having is with the original setup within the graph.

    Hope this helps!
     

    Attached Files:

  3. Thibault_potier

    Thibault_potier

    Joined:
    May 4, 2021
    Posts:
    46
    I'm using unity 2018.4.31 and my visual effect graph is "up to date" with version 4.10.0. I do not have the little "world/local" toggles that's why I used the "transform local to world" blocks. From your explanations I think I wired it properly but still got this issue




     
  4. VladVNeykov

    VladVNeykov

    Unity Technologies

    Joined:
    Sep 16, 2016
    Posts:
    550
    Oh, that brings back memories! :)

    I just installed it to check, something like this should work:


    It should give you something like this:
     

    Attached Files:

  5. Thibault_potier

    Thibault_potier

    Joined:
    May 4, 2021
    Posts:
    46
    Thanks a lot for your help

    I tried your solution, but rotating my gameobject result in weird behaviour. It doesn't "shoot" in the forward axis. I mean that rotating the object does'nt rotate the direction where it shoots

     
  6. Thibault_potier

    Thibault_potier

    Joined:
    May 4, 2021
    Posts:
    46
    Weird : it seems to work now. I have the exact same setup as in my last gif, but now it behave properly. I'm a bit lost here ^^

    Thanks a lot for your time
     
    VladVNeykov likes this.
  7. VladVNeykov

    VladVNeykov

    Unity Technologies

    Joined:
    Sep 16, 2016
    Posts:
    550
    Maybe the graph didn't save/recompile or something. I promise it gets better in newer versions for when you have a chance to upgrade :)

    You're most welcome, good luck with your project!
     
  8. Thibault_potier

    Thibault_potier

    Joined:
    May 4, 2021
    Posts:
    46
    I don't know what to think, it's not working anymore.

    I tried to save, quit, reload project
    I played with the "compile" button on the top right of the window
    I noticed that the small (*) stay no matter what on the top left of the window, which I found weird



    But no matters what I do, it just doesn't work :(



    I will try to replicate it in an empty project, but I need it to work in this project :{
     
  9. Thibault_potier

    Thibault_potier

    Joined:
    May 4, 2021
    Posts:
    46
    Ok, it is working again.

    what I just did is click on the "force runtime mode" button of the vfx graph window



    I don't know what to understand from that, since I compiled / launched play mode several times, without success.
    I get the feeling that it will randomly fail again eventually.

    I'm experimenting both enthusiasm and anxiety regarding the vfx graph :O
     
  10. VladVNeykov

    VladVNeykov

    Unity Technologies

    Joined:
    Sep 16, 2016
    Posts:
    550
    Your Transform Vector operator is set to Local on both inputs. The Transform input I believe should be set to W.

    The earlier version of the VFX Graph were save-able by pressing Ctrl+S. We added a dedicated save button later, but for the version you are in press Ctrl+S to remove the (*).
     
    Thibault_potier likes this.
  11. Thibault_potier

    Thibault_potier

    Joined:
    May 4, 2021
    Posts:
    46
    Yes I spent some times tweaking all the parameters again as I was desperated. A faulty maneuver from me is not to exclude, but I tried everything several times before I started to screenshot things. Weirdest thing is that everything was working when I saved the project yesterday

    Also when I CTRL+S It seems to save the scene , but no matters what I do the (*) never disappear off the vfx graph window
     
  12. VladVNeykov

    VladVNeykov

    Unity Technologies

    Joined:
    Sep 16, 2016
    Posts:
    550
    If the issue persists, please feel free to share your effect and I can take a look.

    This could be an issue in that version; the VFX/Unity version you are on are almost 3 years old and 4.10.0 was still an experimental/preview version (the VFX Graph is on 12.0.0 in 2021.2). If you can, I would definitely recommend upgrading :)