How do I make a part/brick looping the same animation. I want the brick to move from x: 0 to x: 1 And then it turns invisible or transparency = 1 and start from x: 0 again (Transparency = 0)
No script so far.
How do I make a part/brick looping the same animation. I want the brick to move from x: 0 to x: 1 And then it turns invisible or transparency = 1 and start from x: 0 again (Transparency = 0)
No script so far.
Did you mean move from the axis x:0 to axis x:1?
Try putting this script under the part.
-- This code make it move from x:0 to x:1 all WHILE going transparent.
-- Then it repeats all over again from being at its original position and transparent 0
local part = script.Parent
while true do
part.Transparency = 0
part.Position = Vector3.new(0, 0, 0) --Put the desired original position instead
for i = 0, 1, 0.1 do
part.Transparency = i
part.Position = Vector3.new(i, 0, 0)
wait(0.1)
end
wait(1)
end
--This code makes it move from x: 0 to x: 1 BEFORE making it transparent
local part = script.Parent
while true do
part.Transparency = 0
part.Position = Vector3.new(0, 0, 0) --Put the desired original position instead
for i = 0, 1, 0.1 do
part.Position = Vector3.new(i, 0, 0)
wait(0.1)
end
part.Transparency = 1
wait(1)
end
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
Might I just say, instead of using part.Position, use part.CFrame. It will work a lot better.
Some people just tend to get confused if you just show them a CFrame script. Although, yep, it does work better