Jump to content

particles looping?


drarem
 Share

Recommended Posts

I tried created particles in both Start() and Physics() using a state type variable and timer. Although I have

 

self.emit:SetLoopMode(false)

 

And I even do this, and have duration set to 1, it continues to churn out particles. I do a self.entity:Release() of the spawned object and the particles still continue.

 

Thanks.

Link to comment
Share on other sites

You will probably have to attach an example script for people to try. I have noticed that this command shouldn't be set each update as it appears to interrupt the particle emissions. Try this example and see if it works for you:

 

function App:Start()

self.window = Window:Create()

self.context = Context:Create(self.window)

self.world = World:Create()

self.camera = Camera:Create()

self.camera:Move(0,0,-3)

 

self.emitter = Emitter:Create(10)

self.emitter:SetParticleColor(1,0,0,1,0)

self.emitter:SetParticleColor(0,0,0,1,1)

loop = false

self.emitter:SetLoopMode(loop)

 

return true

end

 

function App:Loop()

if self.window:Closed() or self.window:KeyHit(Key.Escape) then return false end

if self.window:KeyHit(Key.Space) then

if loop==false then

loop = true

else

loop = false

end

self.emitter:SetLoopMode(loop)

end

 

Time:Update()

self.world:Update()

self.world:Render()

 

self.context:SetBlendMode(Blend.Alpha)

self.context:DrawText("Press SPACE to change loop mode",2,2)

if(self.emitter:GetLoopMode())then

self.context:DrawText("Particles will loop.",2,22);

else

self.context:DrawText("Particles will not loop.",2,22);

end

self.context:Sync()

return true

end

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...