-
What do you want to achieve? An elevator that tweens up and tweens down
-
What is the issue? I can only teleport the player. Should I keep it like that?
-
Teleport or tween? What do you think?
Tween. It is way more realistic.
I am making a hotel
30character
I don’t know that many games with an actual stable elevator, but there are deffintely ways to make it function like a normal elevator would. If you want a simple system with no issues use teleporting, but if you want something cool, go with that tweening but you may wanna weld the character to the floor or something to make it stable.
Weld the humanoidrootpart To the primarypart of the elevator or just the floor.
Then make it tween up to the floor of choice, Then remove the weld so the player can leave the elevator
Thanks for the help! I had a friend and he told me to tween it so I am now going to tween it as it will be original in a hotel game.
Please could you provide more information on what you need support on. Do you need support on creating a moving elevator? Have you had a go at creating this and if so what parts are you struggling on?
It really depends on what your use case is and what works best in your situation. Do you want a more realistic look or do you mind the players teleporting.
The way you do this is by using TweenService. Here is a very basic elevator script that I just made that demonstrates how to use TweenService:
local TweenService = game:GetService("TweenService")
local Part = workspace.Part
local StartPosition = Vector3.new(0, 0, 0)
local EndPosition = Vector3.new(0, 10, 0)
Part.Position = StartPosition
local tweenInfo = TweenInfo.new(
10, -- Time the tween takes
Enum.EasingStyle.Linear, -- EasingStyle
Enum.EasingDirection.InOut, -- EasingDirection
- 1, -- How many times you want it to repeat
true, -- Reverse
5 -- Delay
)
local Tween = TweenService:Create(Part, tweenInfo, {Position = EndPosition})
Tween:Play() -- Starts the tween
I’m making a hotel elevator
30