Game Development Community

Loading a new level

by Steve L · in Torque X 2D · 10/27/2008 (2:51 am) · 2 replies

After reading through several forum posts about changing levels I am still having trouble.

The line:

SceneLoader.Load(@"data\levels\A002.txscene");

works fine but when I go to unload the current scene:

SceneLoader.UnloadLastScene();

I get an error in Main.cs:

game.Run(); <----------------------------- Cannot access a disposed object. Object name: 'Texture2D'.


If I step through I see that the actor is still moving right, although I use:

actor.Unpossess();
actor.HorizontalStop();
actor.VerticalStop();

before I call the UnloadLastScene(). I don't know if this is related to the problem.

I am using the PSK and am trying to change levels when the GoldenEggCollectibleComponent is collected.

About the author

Recent Threads

  • Hammer time.

  • #1
    12/03/2008 (11:11 pm)
    I received this very same error. It only occurs when you're using the Platform Starter Kit. Can anyone in tech support help with this?
    #2
    12/21/2008 (10:41 pm)
    Steve, this WAS a known problem, but we've been able to get around it!

    www.garagegames.com/mg/forums/result.thread.php?qt=81442