So I made a connection for my rendering system so whenever a player wants to disconnect the render run service it does connection:Disconnect()
But I get this error so idk what the problem is. If anyone knows please let me know, thank you.
So I made a connection for my rendering system so whenever a player wants to disconnect the render run service it does connection:Disconnect()
But I get this error so idk what the problem is. If anyone knows please let me know, thank you.
BindToRenderStep doesn’t return a Signal, Its a callback, If you look at what it returns, it doesn’t return anything:
BindToRenderStep(name: string, priority: number, function: any): ()
: ()
means it doesn’t return anything
With Normal Events, it returns a RBXScriptConnection
For Example, RenderStepped:Connect()
Connect( func: (deltaTime: number) -> ()): RBXScriptConnection
because it doesn’t return this Connection, You cant Disconnect it.
Edit: you would use UnbindFromRenderStep to Disconnect this Callback.
Expanding on @DasKairo’s answer:
You should be using RunService.RenderStepped
instead:
local conn = game:GetService("RunService").RenderStepped:Connect(foo)
conn:Disconnect()