Replies: 2 comments 3 replies
-
cc @QbieShay |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thank you for the ping @Calinou ! I don't plan to expose get RID because I have plans to have particle nodes spawn other particles for multiple bursts (not yet decided, but i actually had exposed RID in a PR and ultimately took it back). However we can talk about ways to teleport a particle system with inherit velocity. Do you mind explaining better your usecase @follyfoxe ? what do you need this for? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Cue dramatic lighting.
Let's say you are working with particles in godot. You use inherit_property_ratio in the process_material. Using a feature as intended so we should be all good, right? Pretty much.
Until...
You decide to teleport this particle node.
Oh no! The horror.
Particles flying all over the place. This does not look polished or professional at all! This must be fixed post-haste.
You know this would probably be fixed by just spawning a new scene instance every time you need it. But you don't want to spawn a scene every time you want to use this effect. That wouldn't be very efficient.
So you do your research. You look at documentation and even godot's source code. (Thank god the source code is readily available for when things like this happen)
Turns out, there's a little function called RenderingServer.particles_set_emitter_velocity
This is just what you need, and it takes in a RID (Luckily, you know what this is thanks to the ever so reliable godot documentation)
However... It isn't as simple as that. Looking at gpu_particles_2d.h you realize... It does not expose it's RID. So this is all essentially useless.
You look at gpu_particles_2d.cpp, it calls that function.
So you come up with this workaround:
It isn't pretty... but it gets the job done.
It works due to this piece of code in gpu_particles_2d.cpp
...
So what i'm trying to say is.
It would be nice if GPUParticles2D exposed it's RID or even better; Have a property that allows reading and writing to this hidden property.
Beta Was this translation helpful? Give feedback.
All reactions