Console Logging
Printing messages to Console Log.
ctx.AddConsoleMessage("[SampleInspector] Target not found", ConsoleMessageType::Warning);Message Types
ctx.AddConsoleMessage("[Script] Saved settings", ConsoleMessageType::Success);
ctx.AddConsoleMessage("[Script] Something happened", ConsoleMessageType::Info);
ctx.AddConsoleMessage("[Script] This might be wrong", ConsoleMessageType::Warning);
ctx.AddConsoleMessage("[Script] Failed to load asset", ConsoleMessageType::Error);Log once (avoid spam)
static bool warned = false;
if (!warned)
{
ctx.AddConsoleMessage("[SampleInspector] Target not found", ConsoleMessageType::Warning);
warned = true;
}Example: “Nudge Target” with logging
Common mistakes
Last updated
Was this helpful?
