#Error when clearing children in scrolling frame

1 messages · Page 1 of 1 (latest)

scenic stag
#

i get this error when i try to clear the children of my scrolling frame but idk why 23:54:38.725 Players.Teddy_arm.PlayerGui.Inventory.InventoryFrame.ScrollingFrame.InventoryController:4: attempt to index nil with 'Parent' - Studio

    local scrollingFrame = script.Parent.Parent.ScrollingFrame
    local InspectFrame = script.Parent.Parent.InspectFrame
    scrollingFrame:ClearAllChildren()```
unkempt shoal
#

Parent == nil

molten marsh
delicate kraken
#

why not just do scrollingFrame = script.Parent if inventory controller is a child of scrollingframe