[Solved] Reduce particle

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

    Forum Fan

    192 Posts


  • #2, by SimonSWednesday, 25. April 2018, 00:18 2 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") 
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12

    Thread Captain

    1314 Posts

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

    Forum Fan

    192 Posts

  • #4, by SimonSWednesday, 25. April 2018, 10:56 2 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

    1314 Posts

  • #5, by afrlmeWednesday, 25. April 2018, 13:02 2 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

    6773 Posts

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

    Forum Fan

    192 Posts

Write post