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

How would I increase the size of a part using a script but in only one direction?

Asked by 3 years ago
Edited 3 years ago

Hello my script is

Lava = game.Workspace.Lava

while true do game.Workspace.Lava.Size = Vector3.new(347.6,Lava.Size.Y+1,505.2) wait(0.001) end

My question is how would I make it so that the part only expands upwards instead of in both directions?

0
I'm struggling to understand what your problem is cmgtotalyawesome 1418 — 3y

3 answers

Log in to vote
0
Answered by
Speedmask 661 Moderation Voter
3 years ago
Edited 3 years ago

think about it, the part size always expands from the centre, equally in both directions. therefore, if you increased the height by 6, it stretches by 3 in both directions. that means all you have to do is move the position upwards by half the size that you increased, and it will appear as if it grew in one direction :)

also, please don’t use wait(0.001). it doesn’t work. wait will only go down to about 0.033 seconds. look up how to use RunService.Heartbeat as a timer.

0
That makes sense, but is there really no way to make it expand in one direction? Really roblox? If thats true thats kind of sad. SwiftBrickMaster 7 — 3y
0
this is how it should be. the position should be completely independent from the size to make calculations easier. a feature to just move in one direction is quite redundant as all it takes is one extra line of code. this kind of thing is done often in games, it can be easy enough to make your own function that does this :) Speedmask 661 — 3y
Ad
Log in to vote
0
Answered by 3 years ago

Use X,y, and Z Axis. There are probably some tutorials on the internets, I would have put what they mean, but I cannot remember, sorry.

Log in to vote
0
Answered by 3 years ago

try doing. the max roblox wait time is 0.05

Lava = game.Workspace.Lava

while true do 
game.Workspace.Lava.Size = Vector3.new(1,1,10)
wait(0.1)
end

Answer this question