I just started learning code and I wanted to make a tween. But I get a error it says tweenservice:create failed because instance is null how do I solve this?
local tweenService = game:GetService('TweenService') local part = script.Parent local tweeningInformation = TweenInfo.new( 5, Enum.EasingStyle.Bounce, --easing style of tween Enum.EasingDirection.Out, --direction of the tween 10, true, 2 ) local partProperties = { Size = Vector3.new(20,20,20); Color = Color3.new(255, 0, 0); Transparency = 0.5 } local Tween = tweenService:Create(Doort,tweeningInformation,partProperties) Tween:Play()
At this line
local Tween = tweenService:Create(Doort,tweeningInformation,partProperties)
you never called the object "Doort"
You can change line 2 from
local part = script.Parent
to
local Doort= script.Parent
or you can change
Line 20 from
local Tween = tweenService:Create(Doort,tweeningInformation,partProperties)
to
local Tween = tweenService:Create(part,tweeningInformation,partProperties)