# \[Closed\] \[SOLVED\] Horizontal and Vertical scrolling?

**URL:** <https://forums.unrealengine.com/t/closed-solved-horizontal-and-vertical-scrolling/459180>\
**Category:** UI\
**Tags:** scrollbox, unreal-engine, Widget, question, Blueprint, UMG\
**Created:** [December 5, 2019, 9:52pm UTC](https://forums.unrealengine.com/t/closed-solved-horizontal-and-vertical-scrolling/459180 "2019-12-05T21:52:34Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![Milo\_911](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Milo\_911](https://forums.unrealengine.com/u/Milo_911)\
**Post date:** [December 5, 2019, 9:52pm UTC](https://forums.unrealengine.com/t/closed-solved-horizontal-and-vertical-scrolling/459180/1 "2019-12-05T21:52:34Z")

</div>

Is there a way to enable both horizontal and vertical scrolling for Scrollboxes?  
I’m hoping to make a large skill tree similar to Path of Exile, but I’m not sure where to start.

---

<div class="post-metadata">

**Author:** ![ThompsonN13](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ThompsonN13](https://forums.unrealengine.com/u/ThompsonN13)\
**Post date:** [December 5, 2019, 10:37pm UTC](https://forums.unrealengine.com/t/closed-solved-horizontal-and-vertical-scrolling/459180/2 "2019-12-05T22:37:30Z")

</div>

you could create two scroll boxes and have one a child of the other.

---

<div class="post-metadata">

**Author:** ![Milo\_911](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Milo\_911](https://forums.unrealengine.com/u/Milo_911)\
**Post date:** [December 5, 2019, 10:39pm UTC](https://forums.unrealengine.com/t/closed-solved-horizontal-and-vertical-scrolling/459180/3 "2019-12-05T22:39:16Z")

</div>

I tried this, but it doesn’t seem to work! It only allows me to scroll with the topmost scroll box. Unless I’m doing something wrong, that is

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [December 5, 2019, 11:30pm UTC](https://forums.unrealengine.com/t/closed-solved-horizontal-and-vertical-scrolling/459180/4 "2019-12-05T23:30:07Z")

</div>

It’s much easier to use nested canvases for this, the idea is similar to a handling a draggable window, more info here:

> [@Two ways scroll box?](https://forums.unrealengine.com/t/two-ways-scroll-box/89955/3):
>
> Here’s another idea (that worked for me): For mouse dragging: nest two canvases and shift one in the other the top one is the size of the interactable area, the inner one is much larger than the screen - you’d be shifting this one about, it will house all the icons and whatnot \*OnMouseDown \*captures the attention of the top canvas OnMouseMove shifts the inner canvas by CursorDelta For scrolling bars: from my experience, h/v scrollboxes will most likely give you a headache after a while - …

Otherwise you’ll spend half the time recalculating scrollbox offset position, which is no fun at all. If you want manual handles to shift stuff about, consider sliders - much easier implementation.

The only somewhat difficult concept here is zooming in on the current mouse position as it requires a transform. That’s providing you need that functionality to start with.

---

<div class="post-metadata">

**Author:** ![Milo\_911](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Milo\_911](https://forums.unrealengine.com/u/Milo_911)\
**Post date:** [December 6, 2019, 12:15am UTC](https://forums.unrealengine.com/t/closed-solved-horizontal-and-vertical-scrolling/459180/5 "2019-12-06T00:15:37Z")

</div>

That’s so funny, I found this right before you commented! I’m testing it out now, but I’m not sure if I full understand how to do it.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [December 6, 2019, 8:59am UTC](https://forums.unrealengine.com/t/closed-solved-horizontal-and-vertical-scrolling/459180/6 "2019-12-06T08:59:38Z")

</div>

Do tell if you have issues getting it to work. To give you a headstart:

 ![293488-annotation-2019-12-06-084932.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/f/d/2fd7613dad639c61e4301543262f1e6ddc5bd484.png)

The hierarchy is

- [Border]
- [OuterCanvas]
- [InnerCanvas]

The border’s clipping is set to ClipToBounds and the Inner canvas is centred like so:

![293489-annotation-2019-12-06-085011.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/e/b/6ebd869c4ab61484b6a9bcde305f60349ef358fa.png)

Shift + Control + Click the middle tile to get it all in one go (optional since you may have an anchoring idea of your own, of course). The rest of the script is as in the post. You may need to adjust the clamps if the skill tree is not full screen.

The inner canvas is much larger than the outer - the idea is to shift the position of the _inner_ within the _outer_ one.

The illusion is pretty convincing:

[![Image from Gyazo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/c/5/dc5feab50506fc20f082196adfb46e857358fda6.gif)](https://gyazo.com/1b57c9ef03f3ed7ecba5af30dc84358d)

Adding sliders (if needed) should be fairly easy here, map range their 0-1 output to the inner canvas’ offset in its parent. _Should_ work.

Even without map ranging anything, it seems to work _OK_, albeit a wee bit jerky.:

 ![293490-annotation-2019-12-06-091450.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/b/6/9b69d0b916c314ede94a5ba7a97ad923935bf9c9.png)

[![Image from Gyazo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/f/f/bff5c7efdb55bcf47fee7a3c180c6d68e0b99f11.gif)](https://gyazo.com/b12ad515293345d7406e18b3a1106e01)

You may just need to get the numbers _right_. Or extract the exact values from widget elements.

---

<div class="post-metadata">

**Author:** ![Milo\_911](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Milo\_911](https://forums.unrealengine.com/u/Milo_911)\
**Post date:** [December 6, 2019, 11:28pm UTC](https://forums.unrealengine.com/t/closed-solved-horizontal-and-vertical-scrolling/459180/7 "2019-12-06T23:28:23Z")

</div>

This is awesome! Thank you so much for the thorough response, i really appreciate it!  
So, I just recreated the blueprint for the function, but I’m not exactly sure how/when to call the function to get it to work.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [December 6, 2019, 11:39pm UTC](https://forums.unrealengine.com/t/closed-solved-horizontal-and-vertical-scrolling/459180/8 "2019-12-06T23:39:56Z")

</div>

Override onMouseMove in the widget. It’s hiding here:

![293510-annotation-2019-12-06-234302.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/d/a/eda31e10ec7c2de9a5ea9f004db673f523c913e4.png)

---

<div class="post-metadata">

**Author:** ![Milo\_911](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Milo\_911](https://forums.unrealengine.com/u/Milo_911)\
**Post date:** [December 6, 2019, 11:46pm UTC](https://forums.unrealengine.com/t/closed-solved-horizontal-and-vertical-scrolling/459180/9 "2019-12-06T23:46:54Z")

</div>

Oh whoops, okay! Just did that and put the blueprint in there, but it doesn’t seem to be doing anything… I noticed in that other post it says “OnMouseDown captures the attention of the top canvas”… What exactly does that mean? Do i have to override that function with something as well?

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [December 7, 2019, 9:34am UTC](https://forums.unrealengine.com/t/closed-solved-horizontal-and-vertical-scrolling/459180/10 "2019-12-07T09:34:50Z")

</div>

It’s about giving the widget focus.

When you click the widget and there’s nothing explicit to interact with, you will _click through_ to any widget elements underneath (sometimes referred to as tunnelling, I believe). If there are no elements to interact remaining, the input priority is given to the Player Controller.

You can grant widget focus (the above-mentioned attention) in many ways:

- select the root of the widget and set its _isFocusable_ flag _True_
- and then:

 ![293531-focus.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/f/5/2f55e2a1c9210da837902aa30df5138d437f44d4.png)

* * *

Or, which may work better, switch to _UI only_ mode when you open the widget (don’t forget to switch to another mode when you close the widget or non-widget elements will not receive input), since it’s unlikely you’ll need the Player Controller’s responses while the player is fiddling with the skills:

![293532-annotation-2019-12-07-092744.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/8/e/48e085fe5f290fe5151328eb14472c0a576ed804.png)

---

<div class="post-metadata">

**Author:** ![Milo\_911](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Milo\_911](https://forums.unrealengine.com/u/Milo_911)\
**Post date:** [December 7, 2019, 6:28pm UTC](https://forums.unrealengine.com/t/closed-solved-horizontal-and-vertical-scrolling/459180/11 "2019-12-07T18:28:04Z")

</div>

That did it!! It works! Though I noticed that sometimes (not every time) when I click and drag, it still lets me turn the player camera, even after setting the controller input mode to “UI only”. Other than that, it works great!!

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [December 7, 2019, 8:08pm UTC](https://forums.unrealengine.com/t/closed-solved-horizontal-and-vertical-scrolling/459180/12 "2019-12-07T20:08:20Z")

</div>

> Though I noticed that sometimes (not  
> every time) when I click and drag, it  
> still lets me turn the player camera,  
> even after setting the controller  
> input mode to “UI only”.

This should not be possible but here we are. Perhaps the way you switch between the modes is the cause of the inconsistent behaviour?

---

<div class="post-metadata">

**Author:** ![Milo\_911](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Milo\_911](https://forums.unrealengine.com/u/Milo_911)\
**Post date:** [December 10, 2019, 6:28am UTC](https://forums.unrealengine.com/t/closed-solved-horizontal-and-vertical-scrolling/459180/13 "2019-12-10T06:28:14Z")

</div>

Sorry for the delayed response - you were right! There was a problem when switching the widget open/closed. Just had to walk through each step to find it! Thanks again for all of your help! It works fantastically(:

---

<div class="post-metadata">

**Author:** ![Amalgamator](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Amalgamator](https://forums.unrealengine.com/u/Amalgamator)\
**Post date:** [October 15, 2023, 11:35am UTC](https://forums.unrealengine.com/t/closed-solved-horizontal-and-vertical-scrolling/459180/14 "2023-10-15T11:35:54Z")

</div>

Hey everyone, i know this comment is few years too late…But im currently trying to implement the same thing and the link above to the forum doesn’t seem to be working anymore. Can anyone pls provide some more info

---

<div class="post-metadata">

**Author:** ![KSU\_PLKV](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@KSU\_PLKV](https://forums.unrealengine.com/u/KSU_PLKV)\
**Post date:** [December 6, 2023, 7:51pm UTC](https://forums.unrealengine.com/t/closed-solved-horizontal-and-vertical-scrolling/459180/15 "2023-12-06T19:51:19Z")

</div>

Hi! I’ve faced same problem and for two days have been searching for tutorials. Eventually I came to the conclusion that I needed to mix ‘2 canvas panels’ with event tick for function ‘on mouse button down’ that calculate final position by mouse position and start position of inner canvas and set new position.  
 ![изображение_2023-12-06_205717328](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/e/c/cec0db7bf89135740e87f08fe65d230268e4a219.png)

 ![изображение_2023-12-06_205802359](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/5/f/55f0581b1c80a36d78155252c4fbb69cb1da0c56.png)  
 ![изображение_2023-12-06_205827305](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/3/b/f3b619c2fbc46e6d1f45509c8e6e49a56740dd19.png)  
Idk if this decision is optimized but it’s working for me. I’m newbie in it.  
Btw if it matters this is 3D widget are in actor like PC, it doesn’t occur in viewport

---

<div class="post-metadata">

**Author:** ![Zarrar2802](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/zarrar2802/32/710746_2.png) [@Zarrar2802](https://forums.unrealengine.com/u/Zarrar2802)\
**Post date:** [January 29, 2025, 6:47pm UTC](https://forums.unrealengine.com/t/closed-solved-horizontal-and-vertical-scrolling/459180/16 "2025-01-29T18:47:41Z")

</div>

Hi, anychance you could update the post link? It seems to be broken

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [January 29, 2025, 7:51pm UTC](https://forums.unrealengine.com/t/closed-solved-horizontal-and-vertical-scrolling/459180/17 "2025-01-29T19:51:31Z")

</div>

Done. But also, here’s a more involved method catering to the same-ish thing:

> [@How to scale/zoom a widget with blueprints?](https://forums.unrealengine.com/t/how-to-scale-zoom-a-widget-with-blueprints/430983/25):
>
> By somewhat popular demand, I’ve updated this to support adding points of interest: re-jiggled the hierarchy by adding an inner canvas with auto size; we now shift that canvas instead of the image, which also moves and scales all elements attached to it

---

<div class="post-metadata">

**Author:** ![Zarrar2802](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/zarrar2802/32/710746_2.png) [@Zarrar2802](https://forums.unrealengine.com/u/Zarrar2802)\
**Post date:** [January 29, 2025, 8:02pm UTC](https://forums.unrealengine.com/t/closed-solved-horizontal-and-vertical-scrolling/459180/18 "2025-01-29T20:02:24Z")

</div>

Ah yes, I downloaded your project zip file a few days back, though forgot all about it. It’s still on my desktop! Will try implementing this!
