Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local UEHelpers = require("UEHelpers")
- local GetKismetSystemLibrary = UEHelpers.GetKismetSystemLibrary
- local ksl = GetKismetSystemLibrary()
- local engine = FindFirstOf("Engine")
- local canExecute = true
- local init = false
- --- @param cmd string
- function ExecCmd(cmd)
- if not ksl:IsValid() then
- error("KismetSystemLibrary not valid\n")
- end
- ExecuteInGameThread(function()
- ksl:ExecuteConsoleCommand(
- engine,
- cmd,
- nil
- )
- end)
- end
- function Init()
- if init then
- return
- end
- init = true
- LoopAsync(500, function()
- ExecCmd("r.RayTracing.Reflections 1")
- return false
- end)
- end
- function ExecuteDelayedFix()
- if not canExecute then
- return
- end
- Init()
- canExecute = false
- local delay = 50
- while delay < 500 do
- ExecuteWithDelay(delay, function()
- ExecCmd("r.RayTracing.Reflections 1")
- canExecute = true
- end)
- delay = delay * 2
- end
- end
- NotifyOnNewObject("/Script/Engine.Level", function()
- ExecuteDelayedFix()
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement