ScriptSpot

Forum topic · ScriptSpot How To

I am trying to make a SIMPLE particle flow script decreasing speed of particles

By ZooM · 2012-03-20

Description

I am trying to make a simple Particle Flow script decreasing speed of particles. Why this did not work, the variable "vel" is changing? And other important question how to make particles to go on random direction not in single line.

on ChannelsUsed pCont do
(
pCont.useTime = true
pCont.useSpeed = true
)

on Init pCont do
(

)

on Proceed pCont do
(
count = pCont.NumParticles()
speed = .05
t = pCont.particleAge
for i in 1 to count do
(
pCont.particleIndex = i
vel = (speed/t)
print vel
pCont.particleSpeed = [vel,0,0]

)
)

on Release pCont do
(

)

Comments (1)

mark pigott · 2012-08-01

Try this script
Firstly, you set your Speed in a Speed operator but this script
should do the trick It is a log slowdown, which I like better
than that dreaded linear slowdown which is is in "Find Target"
[code]

on ChannelsUsed pCont do
(

pCont.useSpeed=true
pCont.useAge=true
)

on Init pCont do
(

)

on Proceed pCont do
(
count = pCont.NumParticles()
for i in 1 to count do
(
pCont.particleIndex = i
CurID=pCont.particleID

--if (pCont.particleNew) then

(

CurAge=(pow 1.0005 pCont.particleAge)as float
CurSpeed=pCont.particleSpeed
CurSpeed/=CurAge
pCont.particleSpeed=CurSpeed

)
)
)

on Release pCont do
(

)

[code]