# How to lock the aspect ratio of the viewport？

**URL:** <https://forums.unrealengine.com/t/how-to-lock-the-aspect-ratio-of-the-viewport/460053>\
**Category:** Community & Industry Discussion\
**Tags:** viewport, resolution, aspect-ratio, unreal-engine, question\
**Created:** [December 31, 2019, 6:43am UTC](https://forums.unrealengine.com/t/how-to-lock-the-aspect-ratio-of-the-viewport/460053 "2019-12-31T06:43:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nishizhawa](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Nishizhawa](https://forums.unrealengine.com/u/Nishizhawa)\
**Post date:** [December 31, 2019, 6:43am UTC](https://forums.unrealengine.com/t/how-to-lock-the-aspect-ratio-of-the-viewport/460053/1 "2019-12-31T06:43:22Z")

</div>

How to lock the aspect ratio of the viewport, but the window resolution is changeable, like this

 ![294632-tim图片20191231143737.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/6/4/064a9616e6497ee4fe614abf0cf3ed27e23d7c5a.png)

---

<div class="post-metadata">

**Author:** ![mclark4386](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mclark4386](https://forums.unrealengine.com/u/mclark4386)\
**Post date:** [April 19, 2023, 6:56pm UTC](https://forums.unrealengine.com/t/how-to-lock-the-aspect-ratio-of-the-viewport/460053/2 "2023-04-19T18:56:49Z")

</div>

Long time since you asked this, but for those coming later, I think this is probably what you are looking for: [Set Constraint Aspect Ratio | Unreal Engine 5.5 Documentation | Epic Developer Community](https://dev.epicgames.com/documentation/en-us/unreal-engine/BlueprintAPI/Camera/SetConstraintAspectRatio)

That will make it so that there will be black bars if the aspect ratio and the current resolution don’t match.

EDIT: Updated link
