@@footyup314 Its programming. Its simple. If you don't learn, it won't look simple to you but if you have experience, you would know this is very simple and short.
if you dont want to make the script and your lazy use this local TweenService = game:GetService("TweenService") local RunService = game:GetService("RunService") local part = script.Parent 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) }) tween:Play() local lastposition = part.Position RunService.Stepped:Connect(function(_, deltaTime) local currentPosition = part.Position local deltaposition = currentPosition - lastposition
I've been trying to figure out this issue for a bit now and you solved it! Recently, bodymovers were deprecated and I didn't want to learn the new Velocity things lol.
You should tho. Align position and align orientation are quite simple and in a game using this method that he used in the video would not be efficient at all. His run service method is bad as it’s inefficient and runs code every frame. Learn the position and orientation align objects, trust me.
With the same method, how would you go about rotating platforms? changing the Linear Velocity based on the position won’t work anymore because the platform is not actually moving, and changing the Angular Velocity won’t do anything but spin the player xd HELP PLS
If you want to use the same method but for the orientation you have to replace "Part.Position" by "Part.Orientation" , remove "deltatime" and change AssemblyLinearVelocity to AssemblyAngularVelocity
thanks you I was trying to use TweenService but that wasn't working and I wasn't finding a good tutorial, because other tutorials keep saying "copy and paste the code in description" and I wanted to learn how to do this codes and your tuto was perfect, thanks you
Great tutorial! You helped solve my problem with moving the player with the platform. Prior to this video, I watched 3 others but they did not help. Quick question: I am assuming updating the platform's AssemblyLinearVelocity property applies that delta to any object that is touching it?
This was great! But I can just Change the z variables To change how far the platform moves but how do I change how fast it goes maybe changing the time to move back-and-forth?
One question that I have, does RunService.Stepped impact performance? since it's running every physics update constantly updating values would it cause any hinderance to performance with multiple platforms?
@@TheLetusGarden exactly that’s the problem. In THIS PARTICULAR INSTANCE what you are running is very light. People are looking at this video to use it in their game which will obviously include other things than this. Running on inefficient code will not benefit anybody. You should have used align position and align orientation objects to keep the player centered on the object rather than a run service which is highly inefficient and more complex.
@@avinath1 quick idea just don’t calculate huge code inside the Stepped event and put it aside into a delayed while task.wait(anyDelayedTime) and parallel only update the AssemblyLinearPosition of your platform or moving part to let the players' characters stand still on the part Edit: Also amazing video it helped me to solve that issue with standing on the platform
It's cool and all, but everything, expect the player, still ignores my elevator platform. Making like a portal inspired puzzle chamber and my cubes don't move with the elevator. Instead they stay down and "update" their position only when player touches them. But even then - they still do it wrong and go like, half way and not to the top.
Thank you... is work.... but do you think? Have a way to fix the refresh rate...my platform moves 40 on the X axis and you can see it shakes a little... but anyway thank you.
thanks! I am making a Void game and I needed to know how to make one of my "spirit orbs" float and this helped alot! although i will say i want to make it move up and down, not left to right. is there any instruction on how to do that?
the part is tweening but the character does not follow it, the output is spammed with "attempt to perform arithmetic (sub) on Vector3 and number " pls help
can you do it with a button so when a player presses it then it moves up then if they press the button it gose down if they press the button on 1st floor it clls the elevator
@@Splango the only idea i have is putting a part under the models where the players would stand, and then use this script so players could stand on the model because of the part.
how do i make this script but make it move an entire model? im trying to make a moving cargo plane where the player is inside and can jump out without sliding out when it starts moving
create a part and name it "Center" or "Main" and put it in the center of your model(add it to model instance too), make sure it IS ANCHORED. then unanchor ALL other parts of your model and weld each one to your "Center/Main" part. then while tweening you only have to tween 1 part.. Very useful for dropships. (all you have to do to make players NOT slide out is weld their rootpart to the same Center/Main part, then destroy weld on button press (space)
Yes, you are right! I saw the same opinion on official documents. but I didn't find sample code about that. You should make a vedio to teach people use that more efficient method.
i've tried everything but it doesn't work T-T ive tried so many tutorials on this for 3 hours and none of them work, my platform just lies there is there something im doing wrong??
@@memecompilation5727 No it won't, have you even tried it? If you did, you probably did it wrong by using a weld and not a weld constraint. Also, why did you bother replying to a comment posted over a year ago?
Hi! So, I made the moving platform go up and down instead of side to side but for some reason in Roblox studio it works just fine, but when I go to test it in game the movement of the moving platform is choppy, When I try to get on the platform the part freezes for a second or two, then the player gets kicked off. Is there any solution to this?
@@gavingaming854 I believe in the part of the script where it goes (0, 0, -20) you could make it (0, -20, 0) or something along those lines, but I am a begienner coder so don't take my word on it.
It's still as inefficient. The best way to do this is to use a local script and raycast under the player and only do the verification on the returned instance
finally a moving platform script that ACTUALLY works with the studio update
thank you
This is some very simple code that helped me create a part that hit the player off the map in my game. This was very useful, ty!
bro how is this simple to you
@@footyup314 Its programming. Its simple. If you don't learn, it won't look simple to you but if you have experience, you would know this is very simple and short.
if you dont want to make the script
and your lazy use this local TweenService = game:GetService("TweenService")
local RunService = game:GetService("RunService")
local part = script.Parent
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)
})
tween:Play()
local lastposition = part.Position
RunService.Stepped:Connect(function(_, deltaTime)
local currentPosition = part.Position
local deltaposition = currentPosition - lastposition
local velocity = deltaposition / deltaTime
part.AssemblyLinearVelocity = velocity
lastposition = currentPosition
end)
Glad to see you're back! It's been forever
I've been trying to figure out this issue for a bit now and you solved it! Recently, bodymovers were deprecated and I didn't want to learn the new Velocity things lol.
You should tho. Align position and align orientation are quite simple and in a game using this method that he used in the video would not be efficient at all. His run service method is bad as it’s inefficient and runs code every frame. Learn the position and orientation align objects, trust me.
@@avinath1 Yea, I got that under my belt since last month now lol. Compared to before, align pos/orientation are wayy better than this.
@@pengidev4553 I’m still trying to understand it. Could you make a video on it please?
@@avinath1 It is quite efficient acc. To be honest, I find AlignPositon really hard to use.
With the same method, how would you go about rotating platforms? changing the Linear Velocity based on the position won’t work anymore because the platform is not actually moving, and changing the Angular Velocity won’t do anything but spin the player xd HELP PLS
He finally uploads again!!!
Short and sweet. Nice instructional that works!
Even after 2 years, it's still helpful!
If you want to use the same method but for the orientation you have to replace "Part.Position" by "Part.Orientation" ,
remove "deltatime" and change AssemblyLinearVelocity to AssemblyAngularVelocity
Why would you remove deltatime?
thanks you I was trying to use TweenService but that wasn't working and I wasn't finding a good tutorial, because other tutorials keep saying "copy and paste the code in description" and I wanted to learn how to do this codes and your tuto was perfect, thanks you
It isn’t smooth but it works so it’s better than a the other like 7 videos I was trying to use
This helped alot. thank you!
thanks i did not know how to do this and i was on the urge of quitting the obby i was making
Great tutorial! You helped solve my problem with moving the player with the platform. Prior to this video, I watched 3 others but they did not help. Quick question: I am assuming updating the platform's AssemblyLinearVelocity property applies that delta to any object that is touching it?
Thanks for helping me with tweenservice! Now I can make my elevator game!
He has returned! Great video. Will you be continuing the force series? I really wanted to learn how to do the rest.
I'm not sure
I'd like to plan it out a bit more and have some cleaner code. The current force videos aren't great imo
Return of the king 👑
thank you SO MUCH for explaining it to me!
It didnt work nvm
@@rachelbeverlin175 XD LOL
thing is.. when the player moves with the platform it isnt smooth
It’s just lag 😅😅😅😅 all games are like that depending on your lag they all use the sm we script there isn’t a different script to do this with 😅😅😅😅😅
@@alexjbgaming actually I have a pretty solid computer but after I placed a couple of them it started moving weird it’s not lag it’s bad code
Try making it via local script
Its roblox movement delay
Cant fix it
Thank you, it was useful
YOOOOO LETUS IS BACK
how do i make it faster ?
Thank you so much!
Absolutely PERFECT!! tysm
This was great! But I can just Change the z variables To change how far the platform moves but how do I change how fast it goes maybe changing the time to move back-and-forth?
Hey! So if you look in the code it is the 2 in there! Hope that helps!
@@SummitRoblox this helped me thanks idk if the other guy heard this tho
YESSIR MAN ITS BEEN LONG
this works amazingly, but models don't have CFrames. so this will only work on parts alone
Hey! For models, you can weld the model to the PrimaryPart, then apply this code to the model PrimaryPart
@@TheLetusGarden wow, i didnt expect you to answer, but imma try that
@@TheLetusGarden i am kinda confused on what you are trying to say
@@Bidombamb Checkout this devforum post devforum.roblox.com/t/introduction-to-tweening-models/315253
thank you so much
tysm
way better than asking chatgpt!
It’s 4 AM so I’m not absorbing much and can’t test this out for myself rn, but assuming it works this seems like it’s a really good tutorial!
It does
Absolute W, tysm
One question that I have, does RunService.Stepped impact performance? since it's running every physics update constantly updating values would it cause any hinderance to performance with multiple platforms?
It would if you were running intense code. In this example, the core that we are running is very light, so performance isn’t much of an issue
@@TheLetusGarden exactly that’s the problem. In THIS PARTICULAR INSTANCE what you are running is very light. People are looking at this video to use it in their game which will obviously include other things than this. Running on inefficient code will not benefit anybody. You should have used align position and align orientation objects to keep the player centered on the object rather than a run service which is highly inefficient and more complex.
@@avinath1 quick idea just don’t calculate huge code inside the Stepped event and put it aside into a delayed while task.wait(anyDelayedTime) and parallel only update the AssemblyLinearPosition of your platform or moving part to let the players' characters stand still on the part
Edit: Also amazing video it helped me to solve that issue with standing on the platform
@@puresk1111 it’s still not efficient
THANK YOU SO MUCH AAAAAA 😆
thank you! you earned a sub and like from me
How to make it so that the platform doesnt wait so long before returning?
It's cool and all, but everything, expect the player, still ignores my elevator platform.
Making like a portal inspired puzzle chamber and my cubes don't move with the elevator.
Instead they stay down and "update" their position only when player touches them.
But even then - they still do it wrong and go like, half way and not to the top.
How about welding (Motor6D) the cubes to the elevator when they're in the elevator, but not being touched?
@@placeholder4675 We used "align position" thing in the end. Kinda worked.
Is it normal that TweenService isn't the smoothest "annimation" you can do? Because the part is shaking when I activate the tween.
This was very useful!
hi, this video is really helpful. But I have a question, can it transport vehicles?
How would you go about rotating the part in circles?
Note that if youre internet or device is terrible, this wont work.
please put your assets in the description; i cant enter your website since it takes way too long to load and the connection times out.
thx !
great help!!
Thank you... is work.... but do you think? Have a way to fix the refresh rate...my platform moves 40 on the X axis and you can see it shakes a little... but anyway thank you.
Hello, but it always happens to me that in the part where you put Runservice that word is marked in blue
Very useful
thanks! I am making a Void game and I needed to know how to make one of my "spirit orbs" float and this helped alot! although i will say i want to make it move up and down, not left to right. is there any instruction on how to do that?
Nvm btw found out how to make it float up and down
isnt working :/
Tysm this works
Idk how it works but it does and thats all I need thank you for this
Hey great tutorial! Do you know how I could make the part move in one direction instead of going back and forth?
Instead of inout you put in or out in
Enum.EasingDirection.inout
@@ddx5899 srry I meant how do you make the part move forward forever, I tried it and it still goes back and forth
@@CosmicMaanz Set true to false in tweenInfo. The "false" means it will not repeat. The "true" means it will repeat.
WE BACK BABY!!
can u link the script?
the part is tweening but the character does not follow it, the output is spammed with "attempt to perform arithmetic (sub) on Vector3 and number "
pls help
hey can you help me how to make a endless moving platform
can you do it with a button so when a player presses it then it moves up then if they press the button it gose down if they press the button on 1st floor it clls the elevator
yo hes alive
How do you make it go to a specific spot?
How to make it slower?
My part just moves but doesnt move the player with it. Can somebody copy and paste the script?
He's alive?
How could I do this with a part that is spinning instead of just moving
The negative didn't work for me it doesn't turn red how do I fix that - 10 and - 1 aren't red they are blue what am I doing wrong
and if i wanna do a circular path?
it wont work and i think its cus for me the runservice is underlined red so what do i do about it?
What if instead you were moving a model, and wanted the player to stick onto it? How would that work?
same question. have u found a answer>?
@@Splango the only idea i have is putting a part under the models where the players would stand, and then use this script so players could stand on the model because of the part.
@@sandintheocean Or you know you could just get a glue part from the toolbox then glue surface on top and bottom then put the model on top of the part
This might help! devforum.roblox.com/t/wall-stickgravity-controller/432598
Does this still work now?
dosent work it moves the part from where it was and u cant get to it
how do i make this script but make it move an entire model? im trying to make a moving cargo plane where the player is inside and can jump out without sliding out when it starts moving
Make it union unless you want make individual part move
create a part and name it "Center" or "Main" and put it in the center of your model(add it to model instance too), make sure it IS ANCHORED. then unanchor ALL other parts of your model and weld each one to your "Center/Main" part. then while tweening you only have to tween 1 part.. Very useful for dropships. (all you have to do to make players NOT slide out is weld their rootpart to the same Center/Main part, then destroy weld on button press (space)
@@ImJamieX thx
Can I turn it into a thing for my horror game?
is there a way to make it follow a set path?
with the first half it didnt move when i clicked run
this code is very complicated and honestly suboptimal, i recommend looking into "AlignPosition" and "AlignOrientation" instead
Yes, you are right! I saw the same opinion on official documents. but I didn't find sample code about that. You should make a vedio to teach people use that more efficient method.
@@battle-axe 7 months later... challenge accepted, challenge completed, it's up on my channel now. Hope this helps.
if i wanna do a spinning plataform?
Does't work
i've tried everything but it doesn't work T-T
ive tried so many tutorials on this for 3 hours and none of them work, my platform just lies there
is there something im doing wrong??
probably still need help?
@@frostywalker2108 yes, i hate my stupid brain ;-;
@@tianji_xing I can send you the script would that help?
@@frostywalker2108 OMGOMGOMG I'M SO SORRY I DIDN'T SEE IT SOONER, YES!!!! YOU'RE THE BEST
@@frostywalker2108could you send it to me aswell
it is not very optimal to use runservice
How do i make it move slower
In the 5th line just increase the number (increasing number will make it slow).
In this line:
local tweenInfo = TweenInfo.new(2, Enum.EasingStyle.Cubic, Enum.EasingDirection.InOut, -1, true)
change the number in TweenInfo.new(2,
hope it works in the air too
It does!
Wouldn't it be better to just weld the HumanoidRootPart to the platform?
nah the players character just freezes then
@@memecompilation5727 No it won't, have you even tried it? If you did, you probably did it wrong by using a weld and not a weld constraint. Also, why did you bother replying to a comment posted over a year ago?
@@somebody_2837 Tbh. Idk, but i needed help and i fixed it.... It was like you said and i forgot to delete the comment:)
If you weld the root part, your character wouldnt be able to walk around the platform
With this method, the player can still move
Hi! So, I made the moving platform go up and down instead of side to side but for some reason in Roblox studio it works just fine, but when I go to test it in game the movement of the moving platform is choppy, When I try to get on the platform the part freezes for a second or two, then the player gets kicked off.
Is there any solution to this?
This has occurred to me too, I'm not sure if there are any answers to this but hopefully The Letus Garden sees this.
How did u make it up and down
When objects provide player interaction, it is best to make them functional within Local scripts.
@@gavingaming854 I believe in the part of the script where it goes (0, 0, -20) you could make it (0, -20, 0) or something along those lines, but I am a begienner coder so don't take my word on it.
i think its because server lag
runservice is underlined for me! can anyone help?
how to make the platform faster?
been forever!
does this work with models?
How to make ti move up
This Is Not Longer Relevent
Does this work with unions?
you sound like jerma
hi
This method sucks, it means you have to have a loop for every single moving parts which is super unefficient
You can just create a folder and loop through all parts using for i, v in pairs
It's still as inefficient.
The best way to do this is to use a local script and raycast under the player and only do the verification on the returned instance
how to make it client sided
Epic
How do you make it go up and down?
change the goal of the tween
For me it only moves the part not the player.
thats what the second part is for
src code
Based