[Solved] Reduce particle

  • #1, by TinTinTuesday, 24. April 2018, 18:29 6 years ago
    Hi. How can reduce particle into the game slowly and put out? like raining to stop

    Forum Fan

    196 Posts


  • #2, by SimonSWednesday, 25. April 2018, 00:18 6 years ago
    That's more complex:

    emitter = 10.0
    
    startTween("emitter", 10.0, 0.1, 10000, easeLinearIn)
    
    
    
    function onMainLoop()
    
    graphics.getParticles(game.CurrentScene.Objects.object).numberOfEmitted = {0.0,emitter}
    
    if emitter <= 0.1001 then
    
    unregisterEventHandler("mainLoop", "onMainLoop")
    
    end
    
    end
    
    
    
    registerEventHandler("mainLoop", "onMainLoop") 
    

    Thread Captain

    1580 Posts

  • #3, by TinTinWednesday, 25. April 2018, 09:21 6 years ago
    Thanks Simon.  Unfortunately it doesn't work for me. Or I'm somethings wrong 

    Forum Fan

    196 Posts

  • #4, by SimonSWednesday, 25. April 2018, 10:56 6 years ago
    You need to change this: game.CurrentScene.Objects.object to your object,

    And the forum puts a <;= in there that should be <=

    Thread Captain

    1580 Posts

  • #5, by afrlmeWednesday, 25. April 2018, 13:02 6 years ago
    Simon you can fix the issue with the code blocks by editing your post afterwards & just hitting the save button without changing it. It seems to correctly display the code block as intended, but if you edit again then it will likely insert the semi-colons again, so it's a case of rinse & repeat until it removes them - code blocks have always been a pain on the VS forum in one form or another.

    Imperator

    7278 Posts

  • #6, by TinTinWednesday, 25. April 2018, 17:44 6 years ago
    Thanks a lot Simon. It works perfectly

    Forum Fan

    196 Posts