I’m making a moving object that should leave particles behind it as it moves. I’ve set the system to World, which causes it to leave the particles behind, but I haven’t found a way for them to inherit the velocity of the VFX graph which is moving. Ideally it would inherit the velocity, but some drag would slow it down. I tried adding a block to inherit source velocity, but this doesn’t seem to do anything.
I’m starting with a default “Swarm Particle System”, and I have a simple script to move the VFX Graph game object. Can anyone suggest an approach to having particles inherit the velocity of the system at the moment they’re initialized?
Hi, at the moment you have to do it manually by exposing a property to pass the velocity to the graph (typically the gradient of the position of the object)
I’m just trying to get the particles shot out to use the weapon turret’s current velocity (this exposed Vector3 is set by C# code prior to triggering the start event) and then add the random velocity locally.
The approach that JulienF mentioned worked fine for me. I similarly have a Vector3 property on the VFX graph, which I use just like you use, except that for mine it’s set to world velocity, not local velocity as you have it:
Thanks for that! I tried setting velocity in World as well as Local but neither seem to work OK. Perhaps it’s the velocity vector I’m setting that’s the issue. I had set it to the velocity vector of the weapon turret carrying the VFX graph in it so it made sense to me. Maybe it’s also the fact that I’m adding a random local velocity to it. I don’t know really.
If you’re adding more velocity, that should be fine. But if you’re ever “setting” the velocity, that will step over this, so you shouldn’t be setting the velocity more than once.
Thanks, yeah, I understand that. I managed to get it working as expected. The particles were dragging behind too much for my liking but it was my fault - I had Drag values set too high. Turns out for my use-case, it looks better to just keep everything local anyway, but at least with this thread, I’ve learned how to sort this out for other use-cases. Thank you.
It’s subtle, but within the nodes of the graph you’ll see a small button you can toggle between World and Local. Usually you just need to make sure the rendering is done in World, to prevent the particles from moving along with the moving system.
Hey everyone!
Sorry for necro, but it’s 2023 now and I wonder if anything has happened on this front? Couldn’t find a node for inherit emitter velocity, but since documentation is still spotty, I thought I’d ask.
Morning Sir.
If you want to easily retrieve the Velocity of your VFX Graph object what you can do is :
Create a Vector3 Property and make sure to turn the “Exposed” value on.
Name it to something meaning full like “System Velocity” or else.
Use this property where you want to use it. (ex: use it to set the initial Velocity)
Drag your VFX Graph in your Scene and select it.
In your Inspector Tab, add a “VFX Property Binder” component to your VFX Graph.
This Component Script will allow you to easily “Bind” your exposed velocity property to your VFX Graph Velocity.
Click on the “+” sign to create a new Binding and go in the “Transform” category to select “Velocity”
Once this is done, Select the Velocity Binding and set the Property to your exposed Property (in my case, I’ve named it “System Velocity”). And set the Target by assigning your VFX Graph Transform. If everything is properly linked, the Orange Square should change color to Green.
Your VFX Graph Velocity is now properly binded to your Vector3 exposed property. You can use it as you want in your graph. In my example, I’m Inverting the Velocity by multiplying it by -1 so that the particles are pushed behind by VFX Graph direction (like Smoke Exhaust from a car).
Hope this will help. Have a great day.
Thanks so much for the detailed answer, Orson!
I’ll try it today and let people here know how it went or if questions arise. Just wanted to say, I love Unity Forums, you people are so helpful and saved my day more than once <3
Hi there! Reviving this as well…
I tried to use your approach, Orson, and it works somewhat. I have a weird issue where it seems to only work for some particle emissions. If I have a constant emission rate only some of the particles actually inherit the velocity, and if I instead use a burst only some bursts of particles inherit the velocity. For the burst either all particles of a burst inherit the velocity or none do, which is a bit weird. I’ve just used a burst in the gif below as it clearly illustrates how some of the burst inherit the velocity while others don’t. I’ve also added an image of the graph as well as the editor in case something is set up incorrectly. Hope you can help, thanks in advance!
fdwsnu
I can’t really figure out how to add images to the post… So I’ll just post them as attachments
Sorry, I never saw your message… By the look of your screenshot, I would guess that this is due to your Linear Drag value, which is really high. You see, Linear Drag is a force that makes the speed of particles tend toward zero. So, I’m guessing that sometime your inherited velocity isn’t strong enough compared to your Linear drag value.
I’m also shooting in the dark here, but I guess that you try to prevent your particles from crazy velocity?
In this case, trying to max out current velocity could be a better solution than using a Linear Drag force.
Again, sorry to answer a year later, but somehow your post just been notified to me…
Have a lovely day.