Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

tweenservice:create failed because instance is null what is wrong?

Asked by
friso9 -3
2 years ago

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()

1 answer

Log in to vote
0
Answered by 2 years ago

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)
Ad

Answer this question