# Detecting when a viewport changes viewmode. 

**URL:** <https://forums.unrealengine.com/t/detecting-when-a-viewport-changes-viewmode/2858977>\
**Category:** Pipeline & Plugins\
**Tags:** unreal-engine, Epic-Pro-Support, question\
**Created:** [October 16, 2026, 12:51am UTC](https://forums.unrealengine.com/t/detecting-when-a-viewport-changes-viewmode/2858977 "2026-10-16T00:51:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous-edc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous-edc](https://forums.unrealengine.com/u/anonymous-edc)\
**Post date:** [October 16, 2026, 12:51am UTC](https://forums.unrealengine.com/t/detecting-when-a-viewport-changes-viewmode/2858977/1 "2026-10-16T00:51:02Z")

</div>

I am supporting a tool that works alongside PlayerCollision view mode that overrides the engine material to show some specific details. When swapping, this tool also hides static meshes and performs a few other changes. Currently, the user has to use a specific “deactivate” path to undo all the changes that are applied when entering the mode, and swapping back to Lit manually does not properly restore settings.

There does not appear to be a callback on the viewport for when viewmode changes. My current plan is that when my tool enters its special mode it will register the viewport to an editor subsystem. Then I have my editor subsystem tick and detect if any viewports are not in player collision mode any more, and if so it adjusts their settings and removes them from the list.

If there a is a better way to do this, please let me know. I have considered adding a “viewmode changed” callback to the engine but that seems like overkill

---

<div class="post-metadata">

**Author:** ![Cody.Albert](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/cody.albert/32/1088813_2.png) [@Cody.Albert](https://forums.unrealengine.com/u/Cody.Albert)\
**Post date:** [October 20, 2026, 9:02pm UTC](https://forums.unrealengine.com/t/detecting-when-a-viewport-changes-viewmode/2858977/2 "2026-10-20T21:02:16Z")

</div>

Hi,

It might be worth hoisting your tool to be a full UEdMode, as that would give you control over the flow (with an Enter/Exit call to mutate and revert the editor state). If that’s not an option (or if you want to be able to toggle your viewmode in conjunction with different editor modes), I’d recommend the callback approach over a subsystem that ticks and constantly polls the viewports while the tool is in use. I don’t think adding something like FEditorDelegates::OnViewportViewModeChanged would be overkill, though you’ll need to be sure to fire that delegate both in FEditorViewportClient::SetViewMode and SetViewModes.

Best,

Cody
