Crashing via TweenService:Create() when passing boolean to a number property

When passing TweenService:Create() a boolean value for properties that normally accept numbers, either client or server will crash depending on which runs the code.

The following code will cause a crash in the Player, but in Studio it will rapidly spam output with the error Variant cast failed, so this is probably just a sneaky exception. Edit: Recently, Studio now crashes due to this issue.

game:GetService('TweenService'):Create( 
	workspace.Baseplate, 
	TweenInfo.new(1), 
	{Transparency = true} -- Passing a boolean to a float property
):Play()

Note that this only seems to happen with booleans passed to properties accepting numbers (int / float). Passing any other incorrect data type does not cause this issue.

Discovered by @TheFurryFish.

6 Likes