I wanted to make a moving brick. I tried using a build set from the toolbox But the toolbox contains many free models that can cause infections. I was working on a project. The project was an obstacle course, I made a save spawner first at keeping it in my explorer menu in my studio. One of the obstacles were gonna be moving blocks. The goal was to make the player jump on the moving objects as fast you can. 2 bricks will be moving opposite directions. One brick will be moving forward and the other one backward. To do it, I would have to put an animation onto it. The animation helps the brick move. I would put a speed on it and transfer a humanoid so that doesn’t bug. I used a regenerate tool and a barrier. So whenever the moving object moves in the wrong direction. It will be respawned and will still work! This box that I made randomly below can explain better.
02 |
local brick = script.Parent |
05 |
brick.Position = brick.Position+Vector 3. new( 0 , 0.1 , 0 ) |
10 |
brick.Position = brick.Position+Vector 3. new( 0 ,- 0.1 , 0 ) |
11 |
wait() --In this part, you can put any number on how long you want it to wait. |
12 |
end --The end script is so it can regenarate back. |