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.
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.
#2
www.garagegames.com/mg/forums/result.thread.php?qt=81442
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
Torque Owner Danilo Buendia
Default Studio Name