Scaling a cylinder

I am making a simple laser that stretches outwards in one direction.( I’m not exactly sure what I should call this)

local laser = script.Parent

local size = 0.5


while true do
	laser.Transparency = 1
	wait(math.random(1,15))
	laser.Transparency = 0
	for count = 1,30,1 do
		laser.Size += Vector3.new(size, 0.6, 1)
		task.wait (0.01)
	end
	wait (2)
	laser.Size = Vector3.new(0.5, 0.6, 1)
end

the laser is just scaling itself outwards in all directions, is there a way I could make it scale it on just the x axis?

you can do either of these:

replace laser.Size += Vector3.new(size, 0.6, 1)
with laser.Size += Vector3.new(size*count, 0, 0)

or replace laser.Size += Vector3.new(size, 0.6, 1)
with laser.Size == Vector3.new(size*count, 0.6, 1)

the first one will make the laser scale exponentially, and the second one will make it scale linearly.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.