cannot open source file Blueprint/UserWidget.h

I am gonna go crazy. I did the exact same thing on the tutorial here:

it just won’t work. It gives the “cannot open source file Blueprint/UserWidget.h” error on the include secdion of MyProjectGameMode.h why is this happening?

I’m having the same issue, have you figured out the problem yet?

Make sure you have UMG as one of your dependencies in your .build.cs file. And don’t forget to re generate your project files!

view the answer please

I figured it out, apparently it was something ridiculous… Just go to your project folder if you are having this issue and then find the “.uproject” file there and right click it. Select “Generate visual studio project files” this will resolve the issue…

This was the answer for me. Thanks!

I’m using 4.12 and while this worked at some point in 4.11 for me, now it doesn’t.

I use the Engine which version is 4.15.3, and the VS version is 2015.

I can not find the “Generate visual studio project files” option in my .uproject file right click menu.

I try in Unreal Editor, Select File, and click “Refresh Visual Studio project”, it work.

Have fun~

Same problem and same solution works for Unreal Engine 4.18 and Visual Studio 2017 15.4.3.