Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating an emitter that emits particles with a velocity #86

Open
johnnyrainbow opened this issue Jun 27, 2024 · 5 comments
Open

Creating an emitter that emits particles with a velocity #86

johnnyrainbow opened this issue Jun 27, 2024 · 5 comments

Comments

@johnnyrainbow
Copy link

I've noticed that it seems possible to add a gravityForce behaviour to a particle system, but I did not find anything regarding a velocity or acceleration behaviour.

My particular intended use case is I would like to create an emitter can emit particles at a specified vector3 velocity (eg shooting rays from a gun towards a target). If there is another way I can achieve this please let me know! Thank you :)

@Alchemist0823
Copy link
Owner

you can shoot a trail particle towards (0,0,1) then rotate the emitter to the direction you want.

@johnnyrainbow
Copy link
Author

you can shoot a trail particle towards (0,0,1) then rotate the emitter to the direction you want.

What about specifically for the use case of creating projectiles/bullet particles? These need to be emitted and only travel between a distance (an emitted particle should be destroyed once it reaches the target/hit position) so that they don't overshoot their target. At the moment I don't believe that quarks systems can support this, but its quite an important use case. Thoughts?

@Alchemist0823
Copy link
Owner

If you can provide an image, it's much easier to understand. In the space shooter staroyale.io, every single trail effect is powered by quarks. Currently you can attach the emitter to the bullet and set the worldspace property to true. U can use emit over distance option to set the update frequency.

@johnnyrainbow
Copy link
Author

Here's an diagram example.

https://gyazo.com/2aa373b69b17f81ea1453a4f9e600f87

The gun has an emitter that can emit bullet particles. Whenever I shoot, I will want to call something like bulletEmitter.emit(distanceToTarget). It will then emit a particle that dies after it travels that distance

@Alchemist0823
Copy link
Owner

One day, I will make a tutorial one day on how to use quarks to make a bullet in games.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants