• Hey! Register here to create your account, engage with the community, and talk about what is new!

how exactly does particle motion work?

woodpeckercity

New member
Joined
Aug 30, 2023
Messages
4
Reaction score
1
I want to make a visual effect for a flamethrower type weapon, and want the fire particles to start at the player, and then move in the direction they are facing. How would i make a system like that?
 

ARMcPro

Forum adept
Overlord
Joined
Oct 20, 2020
Messages
1,256
Reaction score
353
The main idea is, is you set the Particle Motion to the player's direction with set variable; here is a code that does that with the explanation:
[Template]

It repeats 5 times (so we get 5 particles), inside the repeat, the first block multiplies the player's direction by 5, so the fire will go 5x more, you can change the number if you want your flame to be able to go closer or further, the 2nd block inside the repeat creates our particle, I used a Flame particle with 0.1 0.1 spread so the flame looks a bit random with the variable in the 1st block as the vector parameter and a number 8 as the motion randomizer (you can put whatever you want, but i found 8 to be good) and i display the particle in the 3rd block inside the repeat. and the 4th block is just so they don't spawn in wave and rather they spawn "randomly". wait %random(0,1) has a 50% chance to wait a tick or not so it seems better
 
Top Bottom