edited July 2016 in General Discussion
I have been having trouble with my enemies in my project. Their gameobjects do not disappear from the hierarchy after defeat. I have tested using the same Scene ID for multiple enemies in a scene just to see that the scene id destroys gameobjects with the same id and it does, but the initial enemy still remains after defeat. They are teleported to the center of the scenes and follow even after transferring from scene to scene. They even become active again after an in game reset. I have attempted to solve this problem by referring to the tutorials and tinkering on my own but I am completely stumped. Any help would be appreciated.

Post edited by wtfitsed on
  • Check the Keep Prefab setting in your combatant's Death Settings.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • I have just tried both checked and unchecked and the bug still persists.
  • Hm, are your battles taking place in the same scene or do you use a battle arena scene (e.g. like in this gameplay tutorial)?
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • They take place in a battle arena.
  • The enemy is carried over from the field scene to the battle scene, i.e. it needs DontDestroyOnLoad called to do that - this prevents it from being destroyed upon loading a new scene.

    If a combatant is removed from battle, the game object will only be destroyed if the combatant died and Keep Prefab is disabled. Otherwise you'll have to do that e.g. in their death event or in the battle end event (e.g. destroying all enemy group objects).
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • So the DontDestroyOnLoad being called is what is preventing it from being destroyed. That is good to know. Now I think I'm starting to see the problem. I don't think the event is being recognized as a combatant, hence why Destroy combatants with Destroy All checked isn't working? I just tried adding a Remove Temporary enemy combatants step after the non battle arena scene is reloaded, but nothing happens, I tried putting it before the scene loads and it gets rid of the the enemy event, however it stops loading the rest of the battle end event. (presumably because the event that is running the battle end event is being removed.) So I think a part of the problem is that it sounds like the battle event should become an actual combatant instead of just sort of hanging around in the scene, because then if Keep prefab is enabled, the battle event will still run until it is Destroyed on load right?
  • Hm, is the enemy that remains actually a combatant or the game object with the Battle or Event Interaction component that starts the fight?
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • It is a game object.
  • I'll look into it.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Ok, the game object with the Battle component attached isn't destroyed after a teleport battle - will be fixed in the next update.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Awesome thanks so much for looking into this. You're a great help as always.
Sign In or Register to comment.