# ScrollWidgetIntoView not working in C++, but work in the Blueprints

**URL:** <https://forums.unrealengine.com/t/scrollwidgetintoview-not-working-in-c-but-work-in-the-blueprints/445706>\
**Category:** Blueprint\
**Tags:** unreal-engine, CPP, Blueprint, question\
**Created:** [March 21, 2019, 10:43am UTC](https://forums.unrealengine.com/t/scrollwidgetintoview-not-working-in-c-but-work-in-the-blueprints/445706 "2019-03-21T10:43:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![6r0m](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/6r0m/32/1194563_2.png) [@6r0m](https://forums.unrealengine.com/u/6r0m)\
**Post date:** [March 21, 2019, 10:43am UTC](https://forums.unrealengine.com/t/scrollwidgetintoview-not-working-in-c-but-work-in-the-blueprints/445706/1 "2019-03-21T10:43:02Z")

</div>

I have a ScrollBox and three Overlay childs.

In the C++

```
ScrollBox = Cast<UScrollBox>(Machine_W->GetWidgetFromName(TEXT("MScrollBox")));
UOverlay* ChildOverlay = Cast<UOverlay>(ScrollBox->GetChildAt(1));
if (ChildOverlay) UE_LOG(LogTemp, Warning, TEXT("CUR OVERLAY %s"), *ChildOverlay->GetName())
else UE_LOG(LogTemp, Warning, TEXT("Overlay NOT EXIST"));
ScrollBox->ScrollWidgetIntoView(ChildOverlay, true, EDescendantScrollDestination::TopOrLeft);

```

Overlay is Valid, but function not working.  
But in the blueprints all ok:

 ![271944-capture.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/2/8/328a6734a72e6ef33f73c814384f379ffcab6133.png)

---

<div class="post-metadata">

**Author:** ![6r0m](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/6r0m/32/1194563_2.png) [@6r0m](https://forums.unrealengine.com/u/6r0m)\
**Post date:** [March 21, 2019, 11:47am UTC](https://forums.unrealengine.com/t/scrollwidgetintoview-not-working-in-c-but-work-in-the-blueprints/445706/2 "2019-03-21T11:47:48Z")

</div>

Solved:  
Event Constuct in the blueprint and the Begin Play C++ not the same.  
Begin Play fired before widget initialized. And GetCachedWidget return Null.
