End mission, delete all objects
by __._ · in Torque Game Engine · 09/25/2007 (4:14 am) · 3 replies
I have 3 missions with some objects at the same place.
When I end a mission and start another one, a few objects seem to stay. It's seems like
I have 2 skyobjects, and some objects are placed over the other.
Is there a command to delete all objects ?
When I end a mission and start another one, a few objects seem to stay. It's seems like
I have 2 skyobjects, and some objects are placed over the other.
Is there a command to delete all objects ?
About the author
#2
If you create any objects dynamically during the mission, then make sure you add them to the MissionCleanup group, which is likewise deleted along with any objects contained within, at the end of the mission.
That said, as far as I'm aware, anything you create will be added to the $instantGroup by default, which during run time should be the MissionCleanup group (although the exact group varies depending on the state of the server), so this may not be the root of your problem.
EDIT: To delete all the objects, you should be able to do so by simply deleting the group they're held in, which will delete all objects just before destroying the group. However, as this is already how things are working, you may be hitting a separate issue?
09/29/2007 (5:35 am)
Anything you create within the editor is added to the MissionGroup, the contents of this will be deleted at the end of the mission (see endMission()) This will automatically include things like terrain, sky etcIf you create any objects dynamically during the mission, then make sure you add them to the MissionCleanup group, which is likewise deleted along with any objects contained within, at the end of the mission.
That said, as far as I'm aware, anything you create will be added to the $instantGroup by default, which during run time should be the MissionCleanup group (although the exact group varies depending on the state of the server), so this may not be the root of your problem.
EDIT: To delete all the objects, you should be able to do so by simply deleting the group they're held in, which will delete all objects just before destroying the group. However, as this is already how things are working, you may be hitting a separate issue?
#3
It just didn't remove the MissionGroup well, some objects were deleted, some not.
09/30/2007 (2:14 am)
Ah thanks, you're my hero haha! I used the endGame function. I'm such a noob!It just didn't remove the MissionGroup well, some objects were deleted, some not.
Torque Owner __._