Offset cannot be assigned to

So, i’m trying to create a shadow under every guiobject under the frame

local frame = script.Parent

for i,obj in pairs(frame:GetChildren()) do
	if obj:IsA('GuiObject') then
	local objclone = obj:Clone()
		objclone.Position.Y.Offset = UDim2.new(objclone.Position.X.Scale,objclone.Position.X.Offset,objclone.Position.Y.Scale,objclone.Position.Y.Offset +2.3 )
	end
end

but I keep getting the error Offset cannot be assigned to - Client - LocalScript:6

1 Like

Just do it without the .Y.Offset.

local frame = script.Parent

for i,obj in pairs(frame:GetChildren()) do
	if obj:IsA('GuiObject') then
	local objclone = obj:Clone()
		objclone.Position = UDim2.new(objclone.Position.X.Scale,objclone.Position.X.Offset,objclone.Position.Y.Scale,objclone.Position.Y.Offset +2.3 )
	end
end

As an answer, you cannot assign to any specific position, but rather the position itself.

2 Likes