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

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

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
mark pigott's picture

Try this script Firstly, you

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"

 
 
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]

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.