Debugging
Things will break. Here's how to find out why.
Printing to the Output Log
Your first debugging tool is the Output Log (Window > Output Log in HELIX Studio).
- Blueprint
- Lua
- JavaScript
For formatted output, use Format String or Append nodes to build your message before passing it to Print String.
C++ equivalent (for reference)
// Use the "Print String" node
// Connect your value to the In String pin
// Check "Print to Log" to see it in Output Log
// Check "Print to Screen" to see it as an overlay
-- Basic print (goes to Output Log)
print("Hello from Lua!")
-- Print variables
local health = 75
local name = "Player1"
print(string.format("Player %s has %d HP", name, health))
-- UE log with categories
UE.UKismetSystemLibrary.PrintString(
nil, -- world context
"Debug message", -- message
true, -- print to screen
true, -- print to log
UE.FLinearColor(1, 1, 0, 1), -- yellow
5.0 -- screen duration
)
// Standard console methods (all go to Output Log)
console.log("Info message");
console.warn("Warning message"); // yellow in the log
console.error("Error message"); // red in the log
// Structured data
const playerData = { name: "Player1", health: 75, position: { x: 100, y: 200 } };
console.log("Player data:", JSON.stringify(playerData, null, 2));
// Quick timing
console.time("SpawnEnemies");
spawnAllEnemies();
console.timeEnd("SpawnEnemies"); // prints "SpawnEnemies: 12.34ms"
Blueprint Debugging in HELIX Studio
HELIX Studio (built on UE5) has a powerful visual debugger for Blueprints:
- Breakpoints -- Click the left edge of any Blueprint node to set a breakpoint (red circle). Execution pauses there during Play-in-Editor.
- Watch values -- While paused, hover over any pin to see its current value.
- Step controls -- Use the toolbar buttons to Step Into, Step Over, or Resume.
- Blueprint Profiler -- Window > Developer Tools > Blueprint Profiler shows execution time per node.
Enabling debug flow
When you hit Play with breakpoints set, the editor highlights the execution path with animated wires. This makes it easy to see which branch of an If/Branch node was taken.
Common Errors and Fixes
| Error | What it means | Fix |
|---|---|---|
Accessed None | You're using a variable that's null | Add an IsValid check before using the reference |
Cast Failed | The object isn't the type you expected | Use the Cast Failed pin to handle this case |
Infinite loop detected | A loop ran too many iterations | Check your loop exit condition; use a counter as a safety net |
Module not found (Lua) | require can't find your file | Check the module path matches your folder structure |
Cannot read property of undefined (JS) | Accessing a field on null/undefined | Add null checks or use optional chaining (?.) |
Debugging Network Issues
Multiplayer bugs are the trickiest. Some tips:
- Use
HasAuthorityto check if code is running on the server or client. Print which side you're on. - Watch the Net Mode in HELIX Studio's play settings. Test with "Play As Client" and multiple player windows.
- Log on both sides. Add prints at the start of RPCs (Remote Procedure Calls) to confirm they're being received.
- Blueprint
- Lua
- JavaScript
C++ equivalent (for reference)
// Has Authority -> Branch
// True -> Print "Running on SERVER"
// False -> Print "Running on CLIENT"
function M:OnPlayerAction(player, action)
if self:HasAuthority() then
print("[SERVER] OnPlayerAction:", player:GetName(), action)
else
print("[CLIENT] OnPlayerAction:", player:GetName(), action)
end
end
OnPlayerAction(player, action) {
const side = this.HasAuthority() ? "SERVER" : "CLIENT";
console.log(`[${side}] OnPlayerAction: ${player.GetName()} - ${action}`);
}
Console Commands
Open the console in HELIX Studio with the ` (backtick) key:
| Command | What it does |
|---|---|
stat fps | Show FPS counter |
stat unit | Show frame time breakdown |
UnLua.HotReload | Reload all Lua scripts |
ShowDebug | Toggle debug info overlay |
log LogBlueprintUserMessages Verbose | See all Blueprint print messages |
Tips
- Remove or disable debug prints before publishing. Heavy logging tanks performance.
- Use screen-printed debug text (
Print to Screen) for real-time values you need to watch while playing. - When something works in single-player but breaks in multiplayer, it's almost always a replication or authority issue. Check the Client-Server Model docs.