I’m looking to replicate a beam in a GUI to make an image scroll infinitely without cutting, how might I do this?
2 Likes
-- something like this should work, havent tested it though
local amount = 0
gui.AnchorPoint = Vector2.new(0,.5)
gui.Size = UDim2.fromScale(1,2)
while task.wait() do
gui.Position = UDim2.fromScale(0,(amount / gui.Parent.AbsoluteSize.Y) % 1)
amount += 1
end
Edit : You should probably move this into scripting support since it’s kind of impossible to move a gui without a script.
1 Like
where would I put this? I put it in the GUI I have and it didnt work.
1 Like
Did you define the gui
variable?
1 Like
Do not use the script above. You should not use a while loop for things like this.
Please explain exactly what you’re trying to achieve.
1 Like
Ok then,
local RunService = game:GetService('RunService')
local gui = script.Parent
local amount = 0
local speed = 1.3
gui.AnchorPoint = Vector2.new(0,.5)
gui.Size = UDim2.fromScale(1,2)
RunService.RenderStepped:Connect(function(dT)
gui.Position = UDim2.fromScale(0,(amount / gui.Parent.AbsoluteSize.Y) % 1)
amount += dT * speed
end)
Try putting the new one in a local script inside a gui again.
1 Like
Example:
My Ideas:
I know I could do this via a local script but I don’t know how to make an image scroll infinitely.
I also thought I could make a scrolling frame with a particle emitter that puts out the beam, but I don’t know how to control the emitter’s scroll speed.
2 Likes