Detailed Description:
According to the Roblox UnbindFromRenderStep
API documentation (RunService | Documentation - Roblox Creator Hub), the method should raise an error when there’s no function bound with the provided name. However, in-studio, the method doesn’t produce any errors, regardless of whether a function with the specified name has been bound or not.
Where it happens:
This discrepancy has been observed in Roblox Studio, in an pre-exsisting workspace, as-well as in an empty baseplate. I haven’t tested this in a live game.
When it happens:
I suspect this issue has been ongoing for some time, but I have only recently become aware of it.
Videos and Images:
- Api Docs
- Studio
Reproduction Steps:
- In Roblox Studio, create a new baseplate and insert a script into the workspace, set the RunContext to local.
- Insert the following code and start a play session, to attempt unbinding a non-existent function via the
UnbindFromRenderStep
method:
local RunService = game:GetService("RunService")
RunService:UnbindFromRenderStep("test") -- Expected error, but none is produced.
RunService:UnbindFromRenderStep("test") -- Expected error, but none is produced.
print("All tests passed with no errors") -- This line executes successfully.
Further Test:
Replace the above code with the following example (Copied from the API documentation) into the script. Start a play session. This will also showcase that the pcall
function doesn’t capture any errors, suggesting that none are raised:
local RunService = game:GetService("RunService")
local success, message = pcall(function() RunService:UnbindFromRenderStep("drawImage") end)
if success then
print("Success: Function unbound!") -- Unexpectedly, this line prints.
else
print("An error occurred: "..message)
end