先看一下UE和VS的兼容性

为了让VS更好兼容UE5,因此这里下载VS2022版本

步骤

一、Visual Studio下载安装

1. 进入Visual Studio 官网,点击下载

下载社区版即可

下载后点击应用程序开始安装

2. 在安装程序的“工作负荷”面板,先勾选“使用C++”的游戏开发,然后勾选“Windows 10 SDK”和“Unreal Engine 安装程序”

在安装程序的“单个组件”面板,保证如下选项已被勾选:

3. 可以再设置一下安装位置

4. 点击安装

5. 其它注意
1.UE5.4不支持VS2022之前的版本

2.VS2022安装选项要有

.NET 桌面开发
使用 C++ 进行桌面开发
使用 C++ 进行游戏开发
C++ profiling tools
C++ AddressSanitizer
Windows 10 SDK (10.0.18362 or Newer)
Unreal Engine installer

在单个组件中 选择
.netcore3.1(不受支持)
.net6.0运行时(长期支持)
.netframework4.6.2
.netframework4.7.2
默认勾中的不用取消

二、Visual Studio Integration Tool插件安装

“Visual Studio Integration Tool”插件可与Visual Studio协同工作,以在C++代码中显示有关蓝图资产的信息。

在虚幻商城中搜索“Visual Studio Integration Tool”插件并安装到引擎

在虚幻编辑器中的插件中搜索“Visual Studio Integration Tool”并勾选