Make a moving platform in Roblox Studio! [TUTORIAL]
HTML-код
- Опубликовано: 27 июн 2023
- A quick tutorial that'll show you how to make a working moving platform in your Roblox game! Use this moving platform to violently ram your friends into a wall when they aren't looking.
Hope you enjoy :D
#roblox #studio #robloxstudio #robloxstudiotutorial #tutorial #help #guide #gaming #games #funny #fun #memes #viral #viralvideo #memes #meme #videogames #coding #code #developer #programming #subscribe #tutorial #robloxtutorial #codingtutorial Игры
First 😃
Congrats! Second 😀😄
kids that want attention and they get it bruh
@@thepigxd6704fr
i hate those who go like "Erm erm i am first 🤓" like bro those are the most fuckin annoying ass people ever
It really doesn't matter. It's not gonna make any kind of impact to your own life so why bother with the comment.
@@thepigxd6704
heres the script:
local main = script.parent
local part1 = game.workspace.part1
local part2= game.workspace.part2
localbodypos=instance.new("bodyposition")
bodyPos.Parent = main
while wait() do
bodyPos.Position = part1.Position
wait(1)
bodyPos.Position = part2.Position
wait(1)
end
(Edit this is the most likes I've ever had😁)
thank you very much 😄😃😀
thank you. Guys he did make a small error which is that localbodypos needs to be local (space) bodypos that's why it doesn't work
also capital Instance but you saved a lot of time
ty!
This is very interesting, nice concept glad it’s working out for you.
I’d also like to suggest you don’t use a while true loop to execute this as it will create lag.
My genuine belief is actually that you’re going to want to make
local condition = true
while condition do
-- Your code here
if some_condition then
condition = false
end
end
Trigger and break the condition, to reduce lag you could have the platform move from one desired place to the alternative.
If you have also got multiple of these in your place expect lag.
Awesome tutorial! Thank you so much!
Wow i didnt think that this would be so easy, thanks a lot!!! ❤
same
@@extraelmin42nah same too
To fix the rotating issue, you could make another invisible part, this time anchored, and spawn an AlignOrientation instance inside the platform which aligns its orientation with the anchored part. That way, it doesn't spin.
Edit: Upon further investigation, BodyPosition is deprecated in favor of AlignPosition, which doesn't allow for rotation by default. Optimization, babyyy.
yo
how do u align it tho?
i mean connect
@@Stigbdd there needs to be a target cframe (like a Part instance or smt) and an attachment in that target cframe which you can plug into the alignposition
Nice vid, can you make a tutorial where a part from sky falls and decelarates like a controllable fall or something
Bro THANK YOU I actually want it to tip over for my game :D
Nice!! It’s all set for you then! :DD
Nice tutorial idea.
how do you make it so that the block moves below the player and changes y axis with the player but only when the player isnt mid air
the problem with mine is because it's unanchored, it first falls and then starts moving because mine is like a pole
local main = script.Parent
local part1 = game.Workspace.Part1
local part2 = game.Workspace.Part2
local bodyPos = Instance.new("BodyPosition")
bodyPos.Parent = main
while wait() do
bodyPos.Position = part1.Position
wait(1)
bodyPos.Position = part2.Position
wait(1)
end
my hero
gracias daddy
i did everything the same but my part just keeps falling to the floor (it does move tho)
hello im making a old style roblox game problem is the part doesnt move the player does it have to do with the animations i added or what
how do i make it that it moves from part 1 to part 2 destroys itself waits a random time and repeats
Nice tutorial
Although, I wanna ask how I'd do this if it's path is a curve? I was planning on making cars move on a fixed road with a lot of curves. Thank you
Thank you very much! Detailed, explainable and simple, ill combine it with a camera script to make the part be the focus of the camera and therefore will make the camera move.
how do i make it so when you click a button it moves?
if i put the platform unacnhored it keeps falling
please someone tell me how to fix 😭
Whenever I start my game my part just ragdolls to the floor
Here is my script:
local main = script.Parent
local part1 = game.Workspace.MovingPartAP1
local part2 = game.Workspace.MovingPartAP2
local bodyPos = Instance.new ("BodyPosition")
bodyPos.Parent = main
while wait() do
bodyPos.Position = part1.Position
wait(1)
bodyPos.Position = part2.Position
wait(1)
end
If anyone could help I would really appreciate it!
anchor it?
@@developer225 if its anchored the part will just stay still
anchor it
@@mayzaki3699 Read the comment abpve
Try to fix it's position on Hight, with script
Can you make a button for it? When you click it; the platform starts moving.
Can you adjust the velocity of the part?
Hi can you do a clickable part that teleports you (then it only allows gear/tools)
tysm Pandastroyer!
:)
3RD! And we can make more than 2 points of moving? Like 4 or 3, that its because i want to make a core game
Sure! All you have to do is create as much points as you want and add them to the script. I would give you the script for that, but I’m not able to do it right now. But I’ll do it as soon as I can! :D
Thank you, this was helpful. I just have a question though. How do you make the block move towards the players❓
idk if it gonna work since im a beginner, but i think you have to replace the block position by the player position
@@Prismathicz921 Thank you for the reply but how do you do that?
@@user-fd4sk8ev4d also a beginner here! if i had to guess i'll try to find the HumanoidRootPart of the player? if so we would need the player, it's character, find the HumanoidRootPart and it's Cframe (will probably have to do something like WaitForChild() or wait for the player character to load so you don't get any errors).
local plr = game.Players.LocalPlayer
repeat wait() until plr.Character
local char = plr.Character
local HumanoidRootPart_ = char:FindFirstChild("HumanoidRootPart")
and to have it's CFrame you could just add.Cframe like so :
char:FindFirstChild("HumanoidRootPart").CFrame
all of this was found on a random post on the devforum about someone trying to teleport a player. so i recommend you really understand the script and what it's doing (HumanoidRootPart might be bit tricky to understand even on the documentation if you've never rigged a character on roblox studio before) and stuff but i'm pretty sure you can easily find lots and lots of documentation and if it's not enough then some posts on the roblox devforum explaining just that 👍.
this is the one i need to learn about how to make i search so many but this one very helpful to me
I’m glad to hear that!
How is it with models? Because I have to anchor them
my platform just simply doesnt move idk why just say if u want my script
When I make the main part bigger, The script doesn't work and makes the part fall. How do I make the main part bigger and prevent it from falling?
use different method this one sucks
Can you make the tutorial but for train ?
Can you explain how this works, and why it doesn’t just snap straight to the position?
Its because he put the wait script on so it wait before going straight to the other one. I mean the script waits 1 so the block has 1 time to get to the part When the 1 has passed it Goes to the other. If the 1 value was 0 it would snap over to the part
@@William-bu4sj then why did I put the wait time as 5 and it immediately snapped to each position?
for me the part aint working why no scripts i try work
Hi! I watched the tutorial but the platform in the middle keeps falling down, it moves back and forth but for some reason it won't stay in the air. And if i anchor the platform it just stays still and doesn't move back and forth, what should i do?
Hello! Sorry to hear that. Is it fine if I may have a look at your script?
@@Pandastroyer Yes thx! I just copied and pasted it here
local main = script.Parent
local part1 = game.Workspace.Part1
local part2 = game.Workspace.Part2
local bodyPos = Instance.new("BodyPosition")
bodyPos.Parent = main
while wait() do
bodyPos.Position = part1.Position
wait(1)
bodyPos.Position = part2.Position
wait(1)
end
try to anchori t and try othere stuuf, if won't help make a script wich will fix parts position on hight
anchor it
Are your destination parts anchored???
It doesn't work for me, the part just keeps falling.
thanks
My platform doesn't want to move! please help!
thank you
You're welcome :)
how do i make it go slower when moving? i know how to make the pauses slower but not the speed of the platform
Just increase the wait() command
Hi, I love the video! How do you make it so when you step on teh moving block, it does not tip over
Hi! I recommend making the platform bigger so that it doesn’t tip. :)
@@Pandastroyer Thank you for the reply! do I also have to make those 2 blocks bigger? because if I make the plateform bigger it will not move at all
use a BodyGyro to prevent the part from rotating when a player steps on it.
how do you apply that?
Maybe local bodygyro = instance.new("BodyGyro")
@@Absycal add a BodyGyro object to the part then set the MaxForce very high so it completely stops the part from rotating
alr thanks@@tinazonn
it never works when i try it
can it work with meshes?
I havent bodyposition in front of mypatr☹️
İ tried it in the air and it just fell down and didnt move and when i anchored it you guessed it it stayed still here are my codes
local main = script.Parent
local part1 = game.Workspace.Part1
local part2 = game.Workspace.Part2
local bodyPos = İInstance.new("BodyPosition")
bodyPos.Parent = main
while wait()do
bodyPos.Position = part1.Position
wait(3)
bodyPos.Position = part1.Position
wait(3)
end
same it just wont work as for me it works only across ground
It's "Instance" not "İInstance".
Hope it helped although this was 7 months ago :D
mb I made a mistake. BodyPosition was recently removed so it does not work anymore sadly.
Ty
I only came here to see how to stick to a part.🤣🤣
How to make the platform not tip over, even if it's small?
What I did was I added another block underneath the moving block and turned the block underneath completely invisible then welded both of them together. Make sure the invisible block is wider than the moving block though. Does this make sense and do you know how to weld in roblox studio❓ If not let me know.
@@user-fd4sk8ev4d thanks for your info. And yes, I do know how to weld, just go to constraints, then find weldconstraint, and then weld 2 parts together.
@@BloxxerBoi_m134 You're welcome, did this help? I know how to weld I was just making sure you knew but thank you.
@@BloxxerBoi_m134 you could also do this using join surfaces
i dont know why but its not working for me
How can this be applied on Roblox characters?
Have the local main equal your characters torso. So instead of local main = Script.Parent, you would have it be local main = Script.Parent.Torso. This works because your players torso is a part.
can you respawn it ?
Doesn't work to me idk why?
😥
yall my part ran away into the distance
Actual Script:
local main = script.parent
local part1 = game.workspace.Part1
local part2= game.workspace.Part2
local bodyPos = Instance.new("BodyPosition")
bodyPos.Parent = main
while wait() do
bodyPos.Position = part1.Position
wait(1)
bodyPos.Position = part2.Position
wait(1)
end
it dose not work for me
its not working for me
How do I do this but with an entire model?
Choose the base Part of your model where u want the player to stand.
Then weld all the other parts to the base part.
Modify the script accordingly.
it doesnt work :(
wow it doesnt need tween service
how do you make it so it goes slower when it moves?
bruuuuuuuuuuuuuuuuuuuuuuh, whatch hte vidddd
You change the number inside the wait() commands. There are a few places in the block of code that says wait(1). To Make it go slower you change the number to a number bigger than one. Does this help, If not let me know?
I have a question. Can you make the platform have 3 stops?
Yep! Just add an extra destination part and it’s own separate variable in the code
@@Pandastroyer oh, alright. Thanks!
i do it same, but script isn't working
You have to rename the two parts objects to Part1 and Part2
im using a car mesh
the problem is the car just teleports not moves
It only works on parts but not Meshes. I tried to make a shark move by using this script but it didnt work :(
i tried making a car out of parts and weld constraints and it still doesnt work
@@NonNoobber I think it’s because it’s a model, it doesn’t work on models or meshes, it only works on single parts
I’m just going to use this infor for my tower defense game
Awesome! :)
print("Hello world!")
mine just fall
Doesn't work. I tried and it won't move
Sorry to hear that. However I did check it a couple of days ago and it still works. If you could paste your script down, I’d be happy to help out :)
it works, but it falls to the ground. i need it to float
go to the properties of the platform and turn on massless, when I did that it worked
@@hypersniper1464 it works cuz massless gives the part a weight of 0 so it doesn't fall
Didnt work for me
Im just saying there's a thing called tween
doesn't work
dosent work
local main = script.Parent
local part1 = game.Workspace.part1
local part2 = game.Workspace.part2
local bodyPos = Instance.new("BodyPosition")
bodyPos.Parent = main
while wait() do
bodyPos.Position = part1.Position
wait(5)
bodyPos.Position = part2.Position
wait(5)
end
It doesn't work
It Didnt work
Doesn't Work!
hey man, do you know how to make it immovable by players?
imma try anchoring it
@@NonNoobber anchoring it would make it unable to move iirc, i gave up on roblox studio for now lol
This dont work
how do you make it stable
Sorry, but could you please elaborate? :)
@@Pandastroyerhe means how to ride it without the platform rotating
use a BodyGyro
0:26 Posi...tions
thanks its not working
Didn't work.
Followed the script perfectly, but the platform simply won’t move at all. It will just lie on the floor
I see. Is it fine if I can still see your script, though? But also check if the parts are correctly anchored. :)
anchor it
@@Pandastroyer I have the same problem i also followed the script correctly and anchored the parts and named them correctly but it still wont work. Here is the script:
local main = script.Parent
local part1 = game.Workspace.Part1
local part2 = workspace.Part2
local bodyPos = Instance.new("BodyPosition")
bodyPos.Parent = main
while wait() do
bodyPos.Position = part1.Position
wait(3)
bodyPos.Position = part2.Position
wait(3)
end
Oh for local part2 you did workspace.part2 it's supposed to be game.workspace.part2@@mathiashansen2424
didnt worked
it did not work but u still got a sub
doesnt work for me ;-;
Same
roblox studio remove the bodyposition :)
bruh :(
what script should i put now?
you can still use it, it's just deprecated, meaning you shouldn't be using it for new work. AlignPosition should be used instead.
you are a life saver@@tinazonn
IT IS NOT WORKING! IT KEEPS FALLING DOWN!
Anchor it
Then it won't move. Also how do I keep it from tipping over when I stand on it like toh?@@progaming-yf3zf
It has anchor?
no don't anchor it, that will just stop it from moving entirely. use a BodyGyro to stop it from rotating about.
Part.Anchored = true
dosnt work. dont do its a waste of your time
worked for me
It just sounds like a skill issue for him..
heres the script THAT WORKS:
local main = script.parent
local part1 = game.workspace.part1
local part2= game.workspace.part2
local bodyPos = Instance.new("BodyPosition")
bodyPos.Parent = main
while wait() do
bodyPos.Position = part1.Position
wait(1)
bodyPos.Position = part2.Position
wait(1)
end
idk but it dierperd when i test my game idk why?
This script did not work. Here is a script which worked for me:
local TweenService = game:GetService("TweenService")
local RunService = game:GetService("RunService")
local part = script.Parent CHANGE THIS '2' TO CHANGE SPEED(HIGHER =SLOWER SPEED)
local tweenInfo = TweenInfo.new(2, Enum.EasingStyle.Cubic, Enum.EasingDirection.InOut, -1, true)
local tween = TweenService:Create(part, tweenInfo, {
CFrame = part.CFrame * CFrame.new(0, 0, -10)
Appreciate it, truly. I've been searching for a working one for a while but couldnt find one so thank you
doesn't work
Sorry to hear that. However I did test the script yesterday and it seems to work just fine. If you could, please send your script so that I can possibly help you with the issue you're facing :)
local main = script.Parent
local part1 = game.Workspace.Part1
local part2=game.workspace.Part2
local bodyPos=Instance.new["BodyPosition"]
bodyPos.Parent = main
while wait() do
bodyPos.Position = part1.Position
wait(1)
bodyPos.Position = part2.Position
wait(1)
end
you forgot a space
no two at local part = game
It doesn't work
Sorry to hear that. It would be great if you could specify what didn’t work if you could so I might help
local main = script.parent
local part1 = game.workspace.part1
local part2= game.workspace.part2
localbodypos=instance.new("bodyposition")
bodyPos.Parent = main
while wait() do
bodyPos.Position = part1.Position
wait(1)
bodyPos.Position = part2.Position
wait(1)
end