Random Clouds with object move or scripting

  • #1, by Nikos EwtoThursday, 25. May 2017, 16:59 8 years ago
    Hey there,

    Is there any ready script or how can I make random clouds moving in the Scene

    Newbie

    6 Posts


  • #2, by ke4Thursday, 25. May 2017, 17:50 8 years ago
    Hey there,

    Is there any ready script or how can I make random clouds moving in the Scene

    Check this .ved AFRLme created
    https://wiki.visionaire-tracker.net/wiki/Dynamic_Clouds_(h2)

    Key Killer

    810 Posts

  • #3, by afrlmeThursday, 25. May 2017, 18:29 8 years ago
    Quick note: there's actually another method you could use.

    1. create a few single frame animations. Edit the animation frame create an action part to offset the animation position by 1-10 pixels on each animation loop. Create an execute a script action part after containing something like...
    local cloud = ActiveAnimations["cloud_1"].AnimationCurrentPosition
    
    if cloud.x <= -500 then cloud = {x = (game.WindowResolution.x + 500), y = cloud.y} end


    ... not sure if that's right as I've not tested it, but in theory every 20ms (or whatever global delay value you assign to the animation) it would move the animation across & then check if the top left corner coordinate of the animation is at -500 or less & if so then it would teleport the cloud over to the right hand side of the screen + 500 pixels. You can adjust those values obviously, but it's an alternative approach to the tweening Lua functions & math.random stuff I used in the example I created & shared on the wiki.

    Imperator

    7285 Posts