Board Thread:Game development/@comment-39453665-20190513114759

Hi!

I am trying to resize the BasePlate during "gameplay" and the loop works but the resizing of the BasePlate stops to work after a while...

Just so you know, I am new to LUA and RB Studio, anyway this is what I do

under the BasePlate object I have created a script calles shrinking, in this script I have placed this code

print("Script Shrink::running")



local p = script.Parent -- get the BasePlate object



for i = 1, 512 do -- 512 is also the size of the BasePlate, I could go with a loop of 256,

-- but I do overkill.

-- shrink the square

p:Resize(Enum.NormalId.Left, -1) -- Resize the left side - 1

p:Resize(Enum.NormalId.Front, -1)-- Resize the front side - 1

p:Resize(Enum.NormalId.Right, -1) -- Resize the right side - 1

p:Resize(Enum.NormalId.Back, -1) -- Rsize the back side -1



-- output some numbers please

print("Script Shrink::loop n= " .. p.Size.X .. ' count ' .. i)

-- and do a little waiting, then repeat

wait(0.5)

<p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">end

<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">

<p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">The loop is working fine, it is counting... but the BasePlate itself stops after aproximate the half size is reached, this retreived size is not the same all the time, it could stop on BasePlate.Size.X being 254 or 270 or something else

Does anyone have a clue what I am doing wrong and point me to the right direction ?

//Sincerly

<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"> <ac_metadata title="Studio: for loop resizing BasePlate not working"> </ac_metadata>