I’m trying to make curtain that would smoothly open after player interacts with it, i’ve been trying to achieve that with :Resize() function and for loop, like in this sample script:
script.Parent.ClickDetector.MouseClick:Connect(function()
for i = 1, 10 do
script.Parent:Resize(1,1)
end
end)
The problem is that my mesh is rather small and resize function does not work with numbers below 1, numbers from 0 to 0.5 does not do anything, and numbers from 0.5 (including) to 1, resize part by 1. Is there any way i can make this still using this resize function, or do i need to make it some other way? if so, then is there any easy method to make this?
Here is full script if someone needs it:
local parent = script.Parent
local model = parent.Parent
local isOpen = true
local deb = false
local function ChangingStatus()
if deb == false then
deb = true
if isOpen == false then
isOpen = true
for i = 1, 25 do
wait()
script.Parent:Resize(1,(1.3)/25)
end
deb = false
elseif isOpen == true then
isOpen = false
for i = 1, 25 do
wait()
script.Parent:Resize(1,-(1.3/25))
end
deb = false
end
end
end
model.Parent.click.ClickDetector.MouseClick:Connect(ChangingStatus)