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

How to set a parts position after you resize them? [Not Solved]

Asked by 10 years ago

I wanted to resize all the brick in a model, but want them in the original position they're currently in. Here's the logical process. 1. Take its current value and store it somewhere. 2. resize the brick(And it'll move due to collision check. Keep in mind all bricks are anchored)3. Move the brick in its original position. All that to say, what am I doing wrong? It wont go to its original position. I tried CFrame but it loses its rotational values.

local g = script.Parent["plane.028_plane.018"]:GetChildren()
    for i=1, #g do
    local Stance = Instance.new("Vector3Value",g[i])
        Stance.Name = "Vector"
        Stance.Value = g[i].Position
        g[i].Size = g[i].Size + Vector3.new(4.8,0,0)
        g[i].Position = g[i].Vector.Value
        end
0
Do you want to scale a model, or do you want to shrink the individual Parts of a model but keep them in their previous absolute position? (Not positioned relative to the new sizes of the other Parts) duckwit 1404 — 10y
0
I wanted to shrink the individual parts. and keep them in their previous position Orlando777 315 — 10y

1 answer

Log in to vote
0
Answered by 10 years ago
for _, v in pairs(script.Parent["plane.028_plane.018"]:GetChildren()) do
    --v will be the part
    local position = v.Position
    v.Size = v.Size + Vector3.new(4.8,0,0)
    v.Position = position
end

Cannot test this since I'm at school, best of luck and if this doesn't work then reply with error message

0
Already tried that. Didnt work :c Orlando777 315 — 10y
0
Oh alright... What happened when you did that? VariadicFunction 335 — 10y
0
Same exact thing. Parts resized but didn't move back to their positions. Orlando777 315 — 10y
0
Instead of v.Position do v.CFrame and local position = v.CFrame Nidoxs 190 — 8y
Ad

Answer this question