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

How do I fix scaling in script so that it doesn't glitch on top of player?

Asked by 8 years ago
Edited 8 years ago

I can't seem to figure this out and it's a major issue for my game, but how do I fix the scaling? I have the blocks scale up or down based on it's value within it, but whenever someone changes the value higher while standing on it, the block glitches and goes above the player's head.

MyValue.Changed:connect(function()
    if White.Value == 0 then
        script.Parent.Material = "Brick"
    end
    if Red.Value > 0 then
        script.Parent.BrickColor = BrickColor.new(332)
    elseif Blue.Value > 0 then
        script.Parent.BrickColor = BrickColor.new(1011)
    elseif Green.Value > 0 then
        script.Parent.BrickColor = BrickColor.new(304)
    elseif Yellow.Value > 0 then
        script.Parent.BrickColor = BrickColor.new(1017)
        print(script.Parent.BrickColor)
    end
    local NewSize = ((math.log(MyValue.Value+2))*3) + 100
    MyParent.Size = Vector3.new(20, NewSize, 20)
end)

Here's the simple part that controls the scaling for the guy asking for it.

1
Can you show us code? TheDeadlyPanther 2460 — 8y
0
Well, here's the simple part that controls the scaling. ZoltofLightning 27 — 8y
0
Added to the original post. ZoltofLightning 27 — 8y
0
Anchor the part when you change it's size so that it can't move, then unanchor it. TheDeadlyPanther 2460 — 8y
View all comments (3 more)
0
Umm, they're anchored by default. ZoltofLightning 27 — 8y
0
Well, I don't know then, sorry :/ TheDeadlyPanther 2460 — 8y
1
CFrame will keep a part in a spot regardless of it's surrounding changes. TestingPlace1337 51 — 8y

Answer this question