# How to deselect actor in editor from c++

**URL:** <https://forums.unrealengine.com/t/how-to-deselect-actor-in-editor-from-c/342032>\
**Category:** Plugins\
**Tags:** unreal-engine, editor, Plugins, question, CPP\
**Created:** [December 21, 2015, 12:50am UTC](https://forums.unrealengine.com/t/how-to-deselect-actor-in-editor-from-c/342032 "2015-12-21T00:50:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bleeck](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Bleeck](https://forums.unrealengine.com/u/Bleeck)\
**Post date:** [December 21, 2015, 12:50am UTC](https://forums.unrealengine.com/t/how-to-deselect-actor-in-editor-from-c/342032/1 "2015-12-21T00:50:54Z")

</div>

Hi,

This is a pretty straightforward question. How can I deselect actors from c++? I have a module that spawns actors in the editor and would like to deselect any other actors that were previously selected.

---

<div class="post-metadata">

**Author:** ![Shadowriver](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shadowriver](https://forums.unrealengine.com/u/Shadowriver)\
**Post date:** [December 21, 2015, 1:32am UTC](https://forums.unrealengine.com/t/how-to-deselect-actor-in-editor-from-c/342032/2 "2015-12-21T01:32:17Z")

</div>

> **[UEditorEngine::SelectNone](https://docs.unrealengine.com/5.1/en-US/API/Editor/UnrealEd/Editor/UEditorEngine/SelectNone/)**
>
> Deselect all actors. Does nothing if GEdSelectionLock is true.

You can access UEditorEngine from GEditor, UEditorEngine is editor class extension of UEngine (which you can access from GEngine). Look API reference you will find some general editor controls and entry points to other editor components:

> **[UEditorEngine](https://docs.unrealengine.com/5.1/en-US/API/Editor/UnrealEd/Editor/UEditorEngine/)**
>
> Engine that drives the Editor.

As it is extention of UEngine you can call UEngine functions on it too

---

<div class="post-metadata">

**Author:** ![Bleeck](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Bleeck](https://forums.unrealengine.com/u/Bleeck)\
**Post date:** [December 21, 2015, 11:56pm UTC](https://forums.unrealengine.com/t/how-to-deselect-actor-in-editor-from-c/342032/3 "2015-12-21T23:56:58Z")

</div>

Thanks for that 🙂

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_18eb87d9](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_18eb87d9](https://forums.unrealengine.com/u/anonymous_user_18eb87d9)\
**Post date:** [October 15, 2021, 9:00am UTC](https://forums.unrealengine.com/t/how-to-deselect-actor-in-editor-from-c/342032/4 "2021-10-15T09:00:50Z")

</div>

GEditor-\>GetSelectedActors()-\>DeselectAll();
