Do I need to always unload animations when they have finished?

  • #1, by AkcayKaraazmakMonday, 26. March 2018, 15:50 2 years ago
    Hi guys, do we need to unload animations when the game jumps to other scene? Or when we use loadScene function it automatictly unloads the animations from previous scene?

    Cheerssmile

    Great Poster

    437 Posts


  • #2, by sebastianMonday, 26. March 2018, 16:03 2 years ago
    as far as i know only manually preloaded animations stay in memory and have to be unloaded.

    But to be sure i would advice to wait for an official response to that. 

    Thread Captain

    2331 Posts

  • #3, by AkcayKaraazmakMonday, 26. March 2018, 16:08 2 years ago
    Thanks Sebastian, yea maybe Lee or Simon will write

    Great Poster

    437 Posts

  • #4, by constantinMonday, 26. March 2018, 17:33 2 years ago
    i heard it is not recommended to preload at all. but maybe somebody can explain more about preloading/unloading.

    Forum Fan

    167 Posts

  • #5, by AkcayKaraazmakMonday, 26. March 2018, 17:46 2 years ago
    Why it's not recommened? I always use it because when the scene has heavy animations, it makes the scene very slow if not they preloaded

    Great Poster

    437 Posts

  • #6, by afrlmeMonday, 26. March 2018, 18:04 2 years ago
    Only manually preloaded animations need to be manually unloaded.

    You shouldn't need to preload if you are clever with your animations. Webp format to reduce file size & loading time of animations. Try to keep duplicated frames to a minimum, etc. Also don't have a scene load a ton of animations at the same time if they aren't needed. If your scenes are taking longer than a second to load then you need to work on optimization & try scrapping anything that isn't that important.

    As for preloading, I recommend only using it for the heavier animations. Let the regular ones play normally as they load frame by frame anyway which is fine for animations with low file size per frame.

    & yes it's vitally important you manually unload preloaded animations when you no longer need them as they will eventually fill up the available system resources & the game will start to run laggy - depends on each persons computer. Someone with a potato pc will run into problems much faster.

    Imperator

    6773 Posts

Write post