Flashing rainbow part...? | Tweening

Hello, I have came across an issue when making a plugin. First, you make an animation. Then, you export it. Here is the script my plugin exported, which is flashing rainbow before playing the animation. (there are no background scripts running to effect this part).

--DO NOT EDIT UNLESS YOU KNOW WHAT YOU ARE DOING.
--Script generated with PartAnimator by FunFoxRR

local ts = game:GetService("TweenService");local obj = script.Parent.Parent.Parent.Parent;
script.Parent.Play.Event:Connect(function()
	--for i,v in script.Parent.Parent.start_moves:GetChildren() do print(v.Name..": "..tostring(v.Value)); obj[v.Name] = v.Value end;
	
	local t1 = ts:Create(obj, TweenInfo.new(1, Enum.EasingStyle.Back, Enum.EasingDirection.In), {["CFrame"] = CFrame.new(-36.4500008, 6.50000381, 21.699995, 1, 0, 0, 0, 1, 0, 0, 0, 1),["Color"] = Color3.new(0.827451, 0.211765, 0.219608),});t1:Play();t1.Completed:Wait();--Keyframe 1
    local t2 = ts:Create(obj, TweenInfo.new(1, Enum.EasingStyle.Back, Enum.EasingDirection.In), {["Color"] = Color3.new(0.647059, 0, 0.0117647),["CFrame"] = CFrame.new(-36.4500008, 6.50000381, 21.2999954, 1, 0, 0, 0, 1, 0, 0, 0, 1),});t2:Play();t2.Completed:Wait();--Keyframe 2
    script.Parent.Finished:Fire()
end)

And there is the video to what is happening:

Thanks to any and all help!

By slightly modifying the code above, I had found two things. Unsure if they will actually resolve your issue but are possible causes;

This is a list of Roblox’s Tweens. You’ll notice that for the one you’re using (Back), There’s a curve that goes down before coming back up to indicate the backwards movement of the type. I’m assuming that you’ve chosen this because you want the button to be pushed back. My assumption is that since the same TweenInfo is being used on the colour property too, This is causing the graph to be applied to how the colour changes too, causing it to bounce back to different colours before returning to the original ones.

I had also changed Color3.New to Color3.FromRGB. New depends on each value of Red, Green and Blue (0-1) while FromRGB goes from a range of 0-255. Color3.New is basically FromRGB except it divides its values by 255.

Thanks! Didn’t know back in could do that to me :sweat_smile:

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