Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How can I make a smooth sliding door?

Asked by 5 years ago

I want to make a sliding door for my next hotel on Roblox, and I have found a very smooth sliding door on this game. I am not worried about the design; I just need to know how you can script a smooth motion like that. Plus, it needs to reopen while it is closing (just like in real life).

Can anybody help?

Also, I have done TweenCFrame before, but when the player walks up to it, it ends up going on top of the player's head if the collision is on.

0
This is my first question, so I will add more detail if anyone needs it. Pixelated_MC 33 — 5y
0
You could try using for loops Vid_eo 126 — 5y
0
I did that, but to reopen while it is closing is *very* hard. Pixelated_MC 33 — 5y
0
lerp? Async_io 908 — 5y
0
Use TweenService ChristianTRPOC 64 — 4y

3 answers

Log in to vote
0
Answered by
nachsor 36
5 years ago

Hello Pixelated_MC,

You could always use an animation and just run the animation. That could work, but you would need one for open and one for closing. I can't give you the command to run an animation though if you do that, as I don't know what the command is. If you do know it, could you please tell it to me as I am going to use an animation for a game.

Kind Regards, -Nachsor

0
What do you mean by "animation?" Pixelated_MC 33 — 5y
0
Exactly what it says. An animation. Something *animating*. Dog2puppy 168 — 5y
0
there is a lot of really useful plugins for animating. use one of them and just animate your door :D nachsor 36 — 5y
0
Okay! Thanks for your feedback. Sorry I wasn't understanding. Pixelated_MC 33 — 5y
0
Also, what animation plugin is best? I looked but have not found one used for parts. I only found one for handling characters. Pixelated_MC 33 — 5y
Ad
Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

To do this you can create an animation of the door opening and closing using an animation plugin which you can find on the "Create" page of roblox. You can then use MouseButton1Down to run the animation when clicked on the door like this.

local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()

Mouse.Button1Down:connect(function()
    if Mouse.Target.Name == "Name of Door" then
        local Anim = Instance.new('Animation')
        Anim.AnimationId = 'rbxassetid://IDNUMBERHERE'
        local PlayAnim = game.Workspace.Door:LoadAnimation(Anim)
        PlayAnim:Play()
    end
end)

You can then do the same thing for the closing animation as well.

Hopefully that helps!

0
Thanks for responding! I do not understand what you are trying to say... I have spent a while looking at different methods about animations but cannot figure out what you mean. Sorry! Pixelated_MC 33 — 5y
Log in to vote
0
Answered by 5 years ago

Use animator editor to animate the smooth door closing, then upload it publicly and use it... nothing to do with a script.

0
You need the script to trigger the animation, without it nothing will happen. blackarch 20 — 5y
0
But what type of animation editor should I use? I have searched the plugins menu for quite a while, and have not found a plugin that would work. Pixelated_MC 33 — 5y
0
Use this one here: https://www.roblox.com/library/144373835/Roblox-Animation-Editor you can watch a tutorial on how to use it on youtube. blackarch 20 — 5y

Answer this question