Unity Post Gameplay testing issues

Before we start, I’m not done with the quiver topic yet (it’s 3 AM here. If I try coding anything right now my sibling will kill me :stuck_out_tongue_winking_eye:), but this has been a serious problem for a while, so I figured it’s important for me to bring it up before it slips off my head

As you may be aware, my game runs based on a RespawnManager system. The problem is, after testing the game, the respawners (I.E: the clones of the enemy being respawned) stay in the hierarchy, and I’m guessing it’s the main reason why Unity has been extremely slow on me recently, because it takes time prior to testing the game to delete those NPCs before re-running the game code again, and they frequently bulk up to be a lot, and I mean A LOT of NPCs over time stored there. How do we code it in such a way that post testing, the RespawnManager children are cleaned up? I was thinking of cleaning a list similar to what we do for the AggroGroup, but I’m not sure of that right now, and I won’t be able to test code it for a few more hours

Please leave this topic empty until we finish the quiver. It’s the next problem I want to address, but let’s take it slow before it becomes the third parallel problem I’m dealing with at once (I’ll delete this paragraph at the end)

This should be a fairly quick answer… When exiting play mode, the scene should return to the state it was in before you pressed play…
Go to Edit | Preferences | Editor and scroll down until you find Enter Play Mode Settings.
Make sure that all three of the boxes circled below are un-checked.

In terms of general load times, as the code base gets larger, it takes longer to initially load the scene. some people like to have Play Mode Options checked with the other two unchecked, which loads the scene faster, but invites disaster if there are any statics, and also can leave scenes in distinctly non-pristine shape leading to… bugs that baffle TAs. :smiling_imp: It’s just something that we have to live with in large projects like the RPG project.

Definitely not directly aimed at me :stuck_out_tongue_winking_eye: (I’m just joking, I apologize if sometimes I’m unclear about my bugs). I’ll test this in the morning, and let’s hope it was the only reason for my significant performance issues, otherwise I just might have to start considering saving up for a new system soon… :sweat_smile:

Hehe, when I press play on Spellborne Hunter in the Editor, I usually get up to get a soda while I wait. This is programming. This is the Way.

At this point in time, I just export the game out of the engine as well after every major update. It helps me make sure I didn’t accidentally import or export any library that would permanently screw me over on the long run, and have me investigate for 5 days every single script I recently touched, only to find out I accidentally imported Unity’s experimental library (this recently happened in my Quiver script), and it had to go first :stuck_out_tongue_winking_eye:

The path is different from Unity 2021 LTS, as that’s the version I’m using (for me it’s Edit | Project Settings | Editor | … )

Anyway, all boxes were unchecked before. Any other solutions? (Let’s get back to this after the Quiver)

If the game is really adding GameObjects to the scene that persist after the game has stopped playing and those boxes are unchecked, then I have no other answers. You’ll need to head to the Unity Support Forums and see if they have any solutions.

Privacy & Terms