Create an Elevator Using Prismatic Constraints! - Roblox Studio Tutorial
Вставка
- Опубліковано 13 чер 2024
- In this video, I show you how to use prismatic constraints to create an elevator. I go over how they work, how to set them up, and how to script the logic for our elevator. Hope you enjoy!
▻Comment any questions down below!
▻Make sure to leave a like 👍
▻Subscribe!
/ @bricey
▻Join my Discord!
/ discord
Check out some more Roblox Content!
▻Object Oriented Programming:
• OOP in Roblox #1 - Int...
MAn5FqdtZIG-3Gsp4z
▻Making a Key Card door:
• Key-Card Door in Roblo...
VaMQKxAdv0BA-LoUryn
▻General Roblox Scripting:
• Using Object Values to...
Music:
www.bensound.com/ - Ігри
Just to say that you have a very good teaching skills - you explain stuff in a clear and understandable manner.
Thanks a lot. Please consider making a video about body position. All the best.
Yo this is actually so epic, helped me so much! Keep up the good work! :)
The outro blew my ears.
I love it.
Thank you so much. Understanding it much better now. :D
this channel is underrated- I subbed.
Nice turorial as always!
Thanks. Good Tutorial :D
THATS EXACLY WHAT I NEEDED
Very good building trick, thank u! i made a elevator with no a lot of scripts
Im not sure if i wrote the script wrong or if its outdated already
I like it when the script is in the description so i don't have to lose my sanity to make something
Reminder every peace of code has to be correct
i got the same problem
@@starvinios local clickDetector = script.Parent.Clicker.ClickDetector
local pc = script.Parent.Shaft.PrismaticConstraint
local up = false
clickDetector.MouseClick:Connect(function()
up = not up
pc.TargetPosition = up and 0 or -319
end)
@@aurecthee Thanks
Quality Content!!!!!!!!!!
this vid is underated
Great video! Thank you I struggled a bit at first. Script works for 2024. Be aware of the target position I forgot the - before the value and it took a minute for it to work. Also make sure your adding your target position and not the videos.
-- Access the ClickDetector and PrismaticConstraint
local clickDetector = script.Parent.Clicker.ClickDetector
local pc = script.Parent.Shaft.PrismaticConstraint
-- Variable to track the state (up or down)
local isUp = false
-- Function to handle mouse click event
clickDetector.MouseClick:Connect(function()
-- Toggle the state
isUp = not isUp
-- Set the target position based on the state
if isUp then
pc.TargetPosition = 0 -- Move to the up position (0)
else
pc.TargetPosition = -27 -- Move to the down position (-27)
end
end)
It helped alot
Good tutorial! Please, can you make controllable plane?
I tried that a few months ago and it went horribly, but I can try again
@@BRicey I almost made my plane, but it flies and only works normally in the first person :( If I become to third persons then it can turn over..
There is an issue with prismatics and a reason why tweening would be preferred:
Tweens take up less network resources
Just because constraints don’t require any action on your part to replicate to clients doesn’t mean it has no network cost. In fact, they have more network cost,. Instead of a simple event telling clients that the door has closed, it now has to replicate the exact position of the door.
Constraints, obviously, are bound by physics
Sometimes, accurate physics simulation is a bad thing. While Roblox’s physics engine has gotten better, it is not infallible. It will break sometimes. Tweens ignore physics and keep moving. So, if a player puts something in the elevator shaft, for example, a constraint-based elevator would break and a tween-based elevator would clip through the object. This would probably lead to the object either being flinged to oblivion or inside the elevator, but regardless, the elevator remains functional.
And being bound by physics, players can exploit the system
Roblox distributes the task of simulating physics to players to save server resources. This is even after FilteringEnabled. This means an exploiter could, in theory, break the elevator if the server lets it simulate the elevator’s physics. There is probably a setting to stop this, but I’m not sure.
Perfection.
Ty!
this could be useful for making things like cannons.
i was today making an elevator but it was to glitchy i tried tweening, lerping, with a loop changing the y axe.... and then i opened youtube and this was on my front page.... XD im lucky
...or being spied on.
thank you
How can I use buttons such as floor numbers instead of just a red brick. I have created a panel with buttons on to weld against the wall but when I do this, it doesn't move down.
Tried this, but for some odd reason I cannot make the ClickDetector button to work. It just doesn't respond.
Me too
ty so much this is so easy to do !
how do you get the object to slide across
I'm confused. I did the exact things that he did and then when I clicked play it didn't go down, can someone help me please? Also, I tried to put the prismatic constraints together at the same exact place like the way he did, and it doesn't work. I think this is very out dated
I’ve made the red brick but when I press the brick, the elevator doesn’t go up again
Is there a way to slow down the speed in which it goes up and down?
I want to like a million times
Tween service is more likely for doors but I tried it on making lifts but it's very shaky
exactly why I use this method
I would recommend using prismatic constraints if it works for you, but if it doesn't like me I just used an animation to animate the elevator.
The platform keeps getting stuck in the shaft, any idea how to fix?
can u make it slower that when you press the button that the elevator going lower
Hi, is there a way that I can make the platform go up automatically with a model on it without buttons? I would like it to go up only when there is a model with a player loaded inside of it, if anyone can help me. Thank YOU!!
First :)
no u
How would you have the elevator go up, wait, then come back down with just one click?
I have tried but I can't get the elevator to wait before it comes back down.
I cant even get the elevator to go back up. It goes down to the floor and then the prismatic constraint becomes inactive
It didnt work, the elevator is moving by itself up and if i press the button, nothing works
when setting the lower limit to -20, for some reason it goes to the lift's front, if you set it to 20 it goes to its back, is there any way to fix this?
rotate the attachment
again, just like the last video a watched, it works for everyone but me... i have it with the prismatic constraints connecting the two, but the platform just doesnt move.
I actually encountered the same problem, did everything as suggested and it didn't work at first. Tried it again and found the mistake. The second time I actually didn't group the objects and I noticed that if you change the material of the part it can influence its mass, so try to set the ServoMaxForce to a greater value if you`ve changed the material of the part to a havier one such as metal or concrete.
Or set it as a 'massless'
what code do I use for it to go up and down constanly every 5 seconds?
lets say the prismatic constraint is set to a variable called p
the highest point is 0, and the lowest point is -20
while true do
p.TargetPosition = 0
wait(5)
p.TargetPosition = -20
wait(5)
end
Heya, How can i make a second button that calls the elevator? i tried to Make a second button and rename its parts and even clickdetector and i just put new scripts like
local clickDetector2 = script.Parent.Clicker2.ClickDetector2
and
clickDetector2.Mouseclick:Connect(Function()
up = not up
pc.TargetPosition = up and 0 or -20
end)
But when i tried the elevator would not move at all i checked the Prismatic Constraint and it was reading corectlly but not moving at all... can you help me?
use my pack
@@soillong9755 Where..... not even a link.
thank for elp
doesn’t work for me when i click it it doesn’t go up or down
Can you make it turn with a button?
Could you make a video on how to make certain players have certain scripts? Like instead of putting it in starter player scripts I could make only a few people have it. I'm having trouble figuring out how to do this and maybe you could help.
Just make a script that clones it from serverstorage into the players backpack after checking if the constraint you are looking for is true
heres the script:local clickDetector = script.Parent.Clicker.ClickDetector
local pc = script.Parent.Shaft.PrismaticConstraint
local up = false
clickDetector.MouseClick:Connect(function()
up = not up
pc.TargetPosition = up and 0 or -20
end)
Also, would I be able to change the speed of the lift?
Use the Velocity property to do that.
B Ricey ok thanksss
how can you change the speed?
How do i make them stronger
This is cool, but tweening is better xD
Is this optional to low the speed of that?
For some reason, it can't lift anything other than players, no matter if you set the force to like "inf" or "99999....." it won't lift properly or at the speed it's set to. If there's a way around this, anyone, do let me know.
What have you tried lifting up? Parts?
What’s the point of the target position? What does it do
I wonder
Ummm Can you post that ele to tool box??
can u make a cortex elevator
Can you rig multiple parts to it like a full on elevator?
use weilds
yeah u could use welds or weld constraint
Does this only work for platforms or can it work for a realistic lift with a roof and walls?
I think it should work. Just make sure the roof, clicker and walls of the lift are welded and not anchored. If that doesn't work I would either mess with the settings to give the lift more power or make sure the lift isn't in the shaft or touching the outer walls/doors.
@@glenreidy I can get it to go down but it wont go up again. I tried doing it with just the platform like in this video but it still doesnt work. When it is down it seems like the prismatic constraint becomes inactive.
@@evanslater4551 try altering the power settings.
My ServoMaxForce is set as 150005
plz show how to make E to pick up do run a function using module scripts im having some problem making my project if u upload it would be great!
This will really help but I wanna know how you can get working buttons and floor calls
take it
It’s not working in 2024 do you mind helping me
Hey, idk why but i can't use any of it (Surface, Constrains, Hinge, etc). Did anybody know what's wrong with my studio?
roblox took it off because of the new update.
@@brickplank_films5189 aww, that's too sad :(
btw thanks for the info
Whenever I try it the platform just gets stuck on the pole
I just had that problem. Turns out the clicker was anchored.
i spected a comment of the script
"Sometimes you get bounced up" it makes no sense for you not to get bounced up at that speed.
Can I use this on ziplines horizontally?
Edit: This video is made on my birthday.
Yes! Happy (late...) Birthday!
@@BRicey thx
9:06 VISSIBLE CONFUSION
idk why but my elevator is flinging the player up
Do you know how to make a elimination GUI where when you eliminate someone you it says eliminated player in roblox studio
add me on discord (pumpkin#5143) and i will guide you through the scripting
mine doesnt bounce me up :(
i couldnt do it idk why
Now Teach us how to do it with btools
model pleaseeee!!
the create thing is gone
name game ?
it wont worked for me
Nice but my top part wont fall down
and i dont even have it anchored
Wouldn’t it be easier and smoother to just use tweenservice?
can't you just give us a free model
can you give me model im having problems doing it
dont work, my message has ben delleted beacause i has hate dont work
i do it, place the PrismaticConstraint on the Part that moves,
see "elevator". drive.google.com/file/d/11ZtM4ABFIxmwe8oMq5lRzX7b2q-rjgo9/view?usp=sharing, the file
with buttons, drive.google.com/file/d/1mbLuP1vWJHj4gFYluSPyPenkaIP0Fpxa/view?usp=sharing
It does not work
ur speaking too quiet at 100 volume i can barely hear
doesnt work dude
bit too fast bruv