Jump to content

Why does this.load.path not get reset when starting a new state?


Recommended Posts



I found a strange (to me) behaviour. The 'this.load.path' value is not reset to null or an empty string at the end/start of a new state. I guess i see why you might want to set it once, if you have 1 place that you store all your content, but this behaviour caught me out. 


Is there a reason why it is not cleared automatically? I'd just like to know why the decision was made to have it that way. I guess i have been setting it in each State so this hasn't bit me before! 





Link to comment
Share on other sites

  • 3 weeks later...

I'm not the OP, but I found this as well.

this.game.state.start('Preloader', true, false);

The way I move between states is given above (for example, the above is in my Boot state).


I got hung up briefly the first time I ran into this, but then I figured the load manager was probably for the entirety of the game, so it makes sense it would persist between state changes.

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.

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.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...