# What is the right way to override Destroy behavior?

**URL:** <https://forums.unrealengine.com/t/what-is-the-right-way-to-override-destroy-behavior/364986>\
**Category:** Character & Animation\
**Tags:** destroying-actors, unreal-engine, question, CPP\
**Created:** [July 24, 2016, 5:43pm UTC](https://forums.unrealengine.com/t/what-is-the-right-way-to-override-destroy-behavior/364986 "2016-07-24T17:43:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![USB\_Connector](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@USB\_Connector](https://forums.unrealengine.com/u/USB_Connector)\
**Post date:** [July 24, 2016, 5:43pm UTC](https://forums.unrealengine.com/t/what-is-the-right-way-to-override-destroy-behavior/364986/1 "2016-07-24T17:43:26Z")

</div>

Hi.

I’m working on a local multiplayer game. I want to make it such that when an Actor falls below the kill Z, instead of being destroyed, I want to override the functionality to teleport the pawn to a safe spot instead. Which method is the correct one to override without causing issue? There are so many relevant methods… Destroy(), OnDestroy, Destroyed, BeginDestroy in AActor.

---

<div class="post-metadata">

**Author:** ![NoobsDeSroobs](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@NoobsDeSroobs](https://forums.unrealengine.com/u/NoobsDeSroobs)\
**Post date:** [July 24, 2016, 10:07pm UTC](https://forums.unrealengine.com/t/what-is-the-right-way-to-override-destroy-behavior/364986/2 "2016-07-24T22:07:54Z")

</div>

I would instead make another check that causes you to teleport up BEFORE you get destroyed. Span a trigger volume covering the entire level or check using the tick function that you are not under a safe height. Overriding the destroy function is very easy to ■■■■ up and cause bugs and crashes.

---

<div class="post-metadata">

**Author:** ![USB\_Connector](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@USB\_Connector](https://forums.unrealengine.com/u/USB_Connector)\
**Post date:** [July 25, 2016, 11:48pm UTC](https://forums.unrealengine.com/t/what-is-the-right-way-to-override-destroy-behavior/364986/3 "2016-07-25T23:48:05Z")

</div>

Thanks. I really wanted to avoid this. I would have preferred to just have an override for the destroy function to allow for more versatility with less overhead in the level design but if that’s the way it must be so be it.

---

<div class="post-metadata">

**Author:** ![NomadMonkey](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@NomadMonkey](https://forums.unrealengine.com/u/NomadMonkey)\
**Post date:** [June 19, 2018, 2:20pm UTC](https://forums.unrealengine.com/t/what-is-the-right-way-to-override-destroy-behavior/364986/4 "2018-06-19T14:20:49Z")

</div>

with Pawn you can use `virtual void OutsideWorldBounds() override;`
