TweenService:Create failed because Instance is null

I am making a optimized MainMenu module and I am attempting to tween one of the objects but it prints

TweenService:Create failed because Instance is null - Client

In the output.
Here is the code:

local ArrowRight = CreateObject "TextButton" {
		BackgroundTransparency = 1.0,
		Size = UDim2.new(0.0, 30, 1.0, 0),
		Position = UDim2.new(1.0, 0, 0.0, 0),
		Font = Enum.Font.Arcade,
		TextScaled = true,
		TextColor3 = Color3.new(1.0, 1.0, 1.0),
		Text = ">", Name = "RightArrow",
		ZIndex = 3.0, Parent = ItemFrame}
	local RightArrowOutline = CreateObject "UIStroke" {
		Color = Color3.new(0.0, 0.0, 0.0), Thickness = 2.0,
		Parent = ArrowRight}
	TweenService:Create(RightArrow,
		TweenInfo.new(1.0, Enum.EasingStyle.Quart, Enum.EasingDirection.Out),
		{Position = UDim2.new(1.0, -40, 0.0, 0)}):Play()

The ArrowRight is being created using a CreateObject source code I found and it works beautifully and the object is there and not nil when attempting to tween. I just don’t understand why it’s erroring and returning this in the output. Please help!

I think you meant to write ArrowRight, not RightArrow.

4 Likes

I’m so dumb, thank you for pointing this out haha. It works now.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.