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

Error: "Unable to cast view to Object", what is wrong with my script?

Asked by 5 years ago

I don't exactly know what to do or how to fix it. I'm not allowed to use locals or Instance.name. The error seems to print out "Unable to cast view to object". What seems to be the problem with my script? It'd very happy if someone could give me a corrected version of the script.

IntroDoorsA = function()
    game.Workspace.Map.Intro._IntroA:GetChildren()
    for i, v in pairs(game.Workspace.Map.Intro._IntroA:GetChildren()) do 

    game:GetService('TweenService'):Create(
        game.Workspace.Map.Intro._IntroA:GetChildren(),
        TweenInfo.new(1,Enum.EasingStyle.Bounce,Enum.EasingDirection.Out,0,false,0),
        {CFrame = game.Workspace.Map.Intro._IntroA.CFrame + Vector3.new(-7.5,0,0)}):Play()
    end
end

IntroDoorsB = function()
    game.Workspace.Map.Intro._IntroB:GetChildren()
    for i, v in pairs(game.Workspace.Map.Intro._IntroB:GetChildren()) do 

    game:GetService('TweenService'):Create(
        game.Workspace.Map.Intro._IntroB:GetChildren(pairs),
        TweenInfo.new(1,Enum.EasingStyle.Bounce,Enum.EasingDirection.Out,0,false,0),
        {CFrame = game.Workspace.Map.Intro._IntroB.CFrame + Vector3.new(7.5,0,0)}):Play()
    end
end

wait(0.7)
IntroDoorsA()
IntroDoorsB()
0
When I used to get that error, it was mostly caused by a variable being a part and not a cframe. Try double checking variable types and see which variable is an object. LucarioZombie 291 — 5y

Answer this question