Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Resolved VFX Graph Local transform problem in Prefabs, need help (been at it for weeks)

Discussion in 'Visual Effect Graph' started by philiphansson, Apr 20, 2024.

  1. philiphansson

    philiphansson

    Joined:
    Sep 14, 2021
    Posts:
    5
    I found that the problem is my TRAIL system. Everything before the GPU event TRAIL system works as intended. I can see the particles at the right position if i dont look at the trail. I just cant get the trail to work inside a prefab.

    Before i just had the VFX at 0,0,0 in the world and the player transform as a trail target (where the trails want to go) That worked but not when using it on multiply players. So i want to move this into a prefab and still get the target to work. But i cant figgure out how.

    upload_2024-4-20_14-17-17.png

    If the Set Target Pos is set to local i can see that it gets the position in the prefab that i want it to have. The problem is that its not moving in the world thus creating trails. As the Add Target Position just dont seem to work.

    I Use the property binder in the Prefab , and the TrailTarget as my position to go to. But as the position is the prefab itself as the prefab does not "Live" until i hit play the TrailTarget wont be able to use my former Target in the game world. (The camera target (in the scene) that i used before).

    I cant put it in the property binder when the vfx is in a prefab. So what to do?!?!?

    What i want to do is simply, put the vfx on a player prefab that is not in the scene yet due to ECS hybrid (just wont be in the scene until play).

    Set the target pos on the TRAIL so that it keeps its position relativet to the prefab and the target pos should be added ontop as a tail on the player so anytime player moves the trail moves. Just as it worked before. But adding 0,0,0 that is the trails "inhouse" TrailTarget" in the prefab as the player is 0,0,0 will never animate the trail. What the heck do i do to make this work. Pls send help

    Also put the vfx there (tell me if anything else is needed) And pls help =)
     

    Attached Files:

  2. philiphansson

    philiphansson

    Joined:
    Sep 14, 2021
    Posts:
    5
    Pls send help =(
     
  3. OrsonFavrel

    OrsonFavrel

    Unity Technologies

    Joined:
    Jul 25, 2022
    Posts:
    220
    Morning. Just started to take a look at your package.
    First I would like to be sure about what you're looking to achieve.

    By reading your post and opening your package, what I understand is that you want to create a "Dash trail" effect when the character is moving. But you are not looking at emitting the trails from the surface of the Mesh but rather, on an Orbiting sphere. And this sphere will be attached to the Character's root, hips, or whatever?
    Am I correct?
     
  4. OrsonFavrel

    OrsonFavrel

    Unity Technologies

    Joined:
    Jul 25, 2022
    Posts:
    220
    So, as I said earlier, I hope that I understand properly what you're trying to achieve.
    I've made some changes to your VFX graph, mainly simplifying different aspects while trying to align with what I understood.

    So, with my changes, the VFX can be moved and attached to a Prefab/character and emit the Lightning trails in WorldSpace.I didn't keep the TargetPosition property as I didn't understand its needs. That's why I think that I've missed something in what you are after...
    Unity_biVmg9NXXr_0000-0050_1000x571.gif

    upload_2024-4-22_13-59-47.png

    I still hope this post will help. if not, don't hesitate to keep this conversation live.
    Have a great day.
     

    Attached Files:

    Qriva likes this.
  5. philiphansson

    philiphansson

    Joined:
    Sep 14, 2021
    Posts:
    5

    Hi. I missed your reply. Yes. The System that drives the GPU event is a system that rotates invisible partciles in one place. And the dash trails should inherit their startposition, then be a trail after the player. It has to have a target to be able to know where they should "follow"

    But as i said, when i made it i just had the dash trail prefab in the scene at 0,0,0 or it would not work. As the DashVFX thinks it is at 0,0,0 it inherits its new position (and this works , if you put on the color on the driving system the particles is shown and working. But as soon as i have it in my player prefab the 0,0,0 is a local value. and i cant get the dashes to interact at all with the world. I belive it is bcs if i try to follow 0,0,0 locally it just stays there as it has no other input than the prefab player (that is created after start)



    This is how it is suppose to look (and how it worked when i kept the VFX prefab in the world and inherited the player as a moving target.