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. Let us know your feedback about the Global Illumination changes in the 2023.2 beta.
    Dismiss Notice
  3. Dismiss Notice

VFX Graph - World space & Rotation

Discussion in 'Graphics Experimental Previews' started by cchoi128, Oct 11, 2019.

  1. cchoi128

    cchoi128

    Joined:
    Oct 29, 2018
    Posts:
    7
    Is there a way to make particle spawn according to the arctorus' rotation while output is set to world space?

    In the image shown below, the particle spawn regardless of the arctorus' rotation

    upload_2019-10-10_21-56-32.png

    upload_2019-10-10_21-59-41.png
     

    Attached Files:

    b62303411 and FerdowsurAsif like this.
  2. konsic

    konsic

    Joined:
    Oct 19, 2015
    Posts:
    995
    Try with Velocity tangent node
     
    cchoi128 likes this.
  3. cchoi128

    cchoi128

    Joined:
    Oct 29, 2018
    Posts:
    7
    Thanks Konsic for your quick reply! :)

    My apology in advance if I misunderstood your reply and added in a wrong node.

    I have tried adding a Add Velocity (Tangent) node in all combination under Initial and/or Update

    It gives the velocity a new direction towards the tangent of the arctorus' rotation

    however, the spawn location is still the arctorus' world rotation as seen below :(

    upload_2019-10-10_23-4-27.png
    upload_2019-10-10_23-5-26.png
    upload_2019-10-10_23-5-49.png

    PS: this problem came when I study the Unity's VFX Graph Portal demo. I realize that the Unity demo team did not rotate the portal along any axis. I would like to try write a similar effect with the ability to rotate the effect, leading to this issue :(
     

    Attached Files:

  4. konsic

    konsic

    Joined:
    Oct 19, 2015
    Posts:
    995
    I don't understand you either. You want to rotate the whole effect along some axis? Which one?

    If you need to rotate the spawn position, you only need to add Add Velocity tangent in Update and change the axis of rotation.
    s1.JPG
     
    cchoi128 likes this.
  5. cchoi128

    cchoi128

    Joined:
    Oct 29, 2018
    Posts:
    7
    Thanks for further follow up!

    The desired effect is to spawn particle based on the arctorus' current rotation (along any axis) under world space

    In the image I showed before, you can see arctorus has been rotated (The white outlined arctorus Gizmo) and the spawn location of the particle ignores this information. This issue only comes when it is in world space. In local space I have a working effect.

    However, it is desirable to set it up in world space so that when the object moves quickly, the initialized particle won't follow along, but instead drop onto the ground as if they are separate entities.

    I tried with your method, and it does rotate the end result, I will look further into it today and see if I can bring the object's rotation information into Add Velocity Tangent in Update :)
     
  6. cchoi128

    cchoi128

    Joined:
    Oct 29, 2018
    Posts:
    7
    After some more attempts, I can't reproduce the rotational effect that I noticed yesterday. The spawn location is still following the original ArcTorus' shape and rotation. Due to time constraint, I am leaving this problem as is for now and stick with local space version.

    Thanks Konsic for your help so far.

    If anyone has any idea how to rotate the ArcTorus' and has particle spawn following its rotation under world space, please update this post, i'll be following this post.

    Thanks!
     
  7. FranktheGame

    FranktheGame

    Joined:
    May 9, 2018
    Posts:
    6
    I can't seem to find the Add Velocity Tangent option. Is it gone from newer versions?
     
    JamesArndt likes this.
  8. JamesArndt

    JamesArndt

    Unity Technologies

    Joined:
    Dec 1, 2009
    Posts:
    2,912
  9. douglasdaquino

    douglasdaquino

    Joined:
    Aug 11, 2017
    Posts:
    2
  10. Tonsias

    Tonsias

    Joined:
    Mar 2, 2021
    Posts:
    5
    have the same problem.
    I have an aa box in which the particles should spawn.
    the particles should then not have their position on the object, but in world space -> so do not follow the object when it is moving
    problem here -> I can change to world space, but here the rotation of the aa box is no longer taken into account

    upload_2021-10-20_17-0-48.png
     
  11. Tonsias

    Tonsias

    Joined:
    Mar 2, 2021
    Posts:
    5
    upload_2021-10-20_17-17-24.png

    upload_2021-10-20_17-17-58.png

    I understand where the problem is.
    The middle of the box is kept local, but the size is generated in world space. As a result, the rotation is not transmitted and I spawn the particles incorrectly, but in world space

    when i set it up locally, the aa box works correctly, but when the object is moved or rotated, the particles are moved along with it.
    that's exactly what I don't want. the movement of the object should not have any influence on the particles, but the position and rotation of the aa box should be taken into account
     
    Last edited: Oct 20, 2021
  12. Lex4art

    Lex4art

    Joined:
    Nov 17, 2012
    Posts:
    445
    This may help (at 4:22):
     
    Antice99 and M-Elwy like this.
  13. Tonsias

    Tonsias

    Joined:
    Mar 2, 2021
    Posts:
    5
    Thanks for your message, unfortunately that doesn't help me ... the rotation is taken over ... but the position seems to behave very strangely. Maybe there is a way to save it, but unfortunately that doesn't seem to have been the solution
    upload_2021-10-20_18-14-46.png
     
  14. Tonsias

    Tonsias

    Joined:
    Mar 2, 2021
    Posts:
    5
    i did it. now it works as intended. Particles are in world space but they are created inside the box.
    but that is probably a special solution for aa boxing.
    as described in the video, I generated a point cache and took the points here. but since i want one of my own size i used the size of my aa box to adjust the cube

    upload_2021-10-20_18-58-56.png
     
    Lex4art likes this.
  15. v2-Ton-Studios

    v2-Ton-Studios

    Joined:
    Jul 18, 2012
    Posts:
    237
    Somewhat related to this... I have a visual effect on an object am using a gravity component. No velocity applied at all. When I rotate the object it effects the gravity? This makes no sense to me. Gravity should always be up/down relative to the normal of the surface, right? Why does the object's rotation effect it?
     
  16. Lex4art

    Lex4art

    Joined:
    Nov 17, 2012
    Posts:
    445
    v2-Ton-Studios - on image above, at top right corner there is a pill-shaped "WORLD" sign - if in your graph this is "LOCAL" just click on it to turn it to "WORLD" - this should make gravity act in absolute world coords (but everything else in particle settings will act in world space too).
     
  17. Amirggg

    Amirggg

    Joined:
    Jun 27, 2019
    Posts:
    1
    I know it's too late but i got a solution for anyone seeking an answer to this
    1. set the Shape space to world
    2 Add a set Poistion node after the shape and set it to local
    3. wire in a Get Attribute: Position(Current) to the node you made in step 2 Capture.JPG
     
    HTFClem likes this.
  18. cadris_unide

    cadris_unide

    Joined:
    Jun 11, 2022
    Posts:
    3
    Hello, I am Cadris. I am a new user of Unity. I was working on my project in the VFX graph, Then I see there was no option of velocity in create nodes. Sir, if there is any way to appear it please tell me as soon as possible. Thank you!
     
  19. HTFClem

    HTFClem

    Joined:
    Sep 5, 2018
    Posts:
    19
    I know it's been ages but wanted to say thanks, so strange that we can't just use directly whatever shape/mesh in World Space, but at least there is a work around!
     
  20. fleity

    fleity

    Joined:
    Oct 13, 2015
    Posts:
    283
    It's an old thread but I wanted to add another solution because the previous one only works for systems set to world space.

    If you want the system itself to work in Local space, transforming a zero vector into world space and setting that as the position in the world space shape vector seems to work. Although the shape is displayed at the world center the particles themselves are spawned in the correct spot. If I rotate the visual effect the already spawned particles rotate with the transform but new ones spawn inside the world oriented shape.

    upload_2023-4-24_11-27-26.png