# Getting viewport (screen?) size in editor (not in play mode)

**URL:** <https://forums.unrealengine.com/t/getting-viewport-screen-size-in-editor-not-in-play-mode/1608481>\
**Category:** Blueprint\
**Tags:** editor-viewports, unreal-engine, Blueprint, question\
**Created:** [January 12, 2024, 11:25am UTC](https://forums.unrealengine.com/t/getting-viewport-screen-size-in-editor-not-in-play-mode/1608481 "2024-01-12T11:25:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![SoulburnerSlv](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SoulburnerSlv](https://forums.unrealengine.com/u/SoulburnerSlv)\
**Post date:** [January 12, 2024, 11:25am UTC](https://forums.unrealengine.com/t/getting-viewport-screen-size-in-editor-not-in-play-mode/1608481/1 "2024-01-12T11:25:44Z")

</div>

I’m trying to make some camera editor helpers for my pixel game and for that I need the current size of an editor view port. What’s the way to get it?

GetViewportSize gives me (1,1) because I don’t have HUD.

---

<div class="post-metadata">

**Author:** ![SoulburnerSlv](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SoulburnerSlv](https://forums.unrealengine.com/u/SoulburnerSlv)\
**Post date:** [January 15, 2024, 1:54pm UTC](https://forums.unrealengine.com/t/getting-viewport-screen-size-in-editor-not-in-play-mode/1608481/2 "2024-01-15T13:54:51Z")

</div>

Posting my solution here in case somebody will need it:

```auto
if (FViewport* Viewport = GEditor->GetActiveViewport())
	{
		return Viewport->GetSizeXY();
	}

```

Also, don’t forget to add a “UnrealEd” module in your Build.cs script

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [February 14, 2024, 1:55pm UTC](https://forums.unrealengine.com/t/getting-viewport-screen-size-in-editor-not-in-play-mode/1608481/3 "2024-02-14T13:55:01Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
