Hot reloading with VS Code

Hello,

is there a way to get hot reloading working with Visual Studio Code on Linux?

Hot reloading works perfectly fine if I compile from the editor but nothing happens if I compile from VS Code. I’m using the “[ProjectName]Editor Linux Development Build” build command.

Here are the step to reproduce the problem:

  1. Configure Visual Studio Code as the default source code editor in the editor preferences
  2. Generate the project files via the File menu
  3. Open visual studio code via the File menu
  4. Hit ctrl+shift+b then select [ProjectName]Editor Linux Development Build
  5. Wait for the build to end
  6. No mention to hot reload in the editor’s output log and the code changes are not reflected if I start the game
2 Likes

I found a solution to resolve this problem.

I had the same issue on Linux.

First, You need install the vscode extension.

Then, Generate vscode project file

And you should edit your .vscode/tasks.json file

Like this

{
  "version": "2.0.0",
  "tasks": [
    {
      "label": "MyProjectEditor Linux Development Build",
      "group": "build",
      "command": "Engine/Build/BatchFiles/Linux/Build.sh",
      "args": [
        "-ModuleWithSuffix=${workspaceFolderBasename},${input:randomNumber}", // Add this line
        "MyProjectEditor",
        "Linux",
        "Development",
        "/Ly/code/games/MyProject/MyProject.uproject",
        "-waitmutex"
      ],
      "problemMatcher": "$msCompile",
      "type": "shell",
      "options": {
        "cwd": "/Ly/apps/unreal-engine"
      }
    }
  ],
  "inputs": [ // And add this field
    {
      "id": "randomNumber",
      "type": "command",
      "command": "shellCommand.execute",
      "args": {
        "command": "echo $(( ( RANDOM % 1000 ) + 1000 ))"
      }
    }
  ]
}

And should works perfectly, Sorry, my English is not good.