UnbindFromRenderStep Not Raising Expected Error for Nonexistent Functions in Studio

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:


Reproduction Steps:

  1. In Roblox Studio, create a new baseplate and insert a script into the workspace, set the RunContext to local.
  2. 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

Code source: (RunService | Documentation - Roblox Creator Hub)

3 Likes

We’ve filed a ticket into our internal database for this issue, and will come back as soon as we have updates!

Thanks for flagging!

5 Likes

Thank you for flagging! You’re right, there’s an error on the documentation site. I have posted a fix that will go live soon. Have a great day!

1 Like

This fix is live! Thanks again for the report.

1 Like