How to weld a player to an elevator?

I’ve made an elevator script, but the when the elevator part moves the character with phase through it when going up and float above when going down.

To try and keep the player still, I’ve tried welding them to the part

Weld ="Weld", Elevator)
Weld.Part0 = Elevator
Weld.Part1 = Player.Character.HumanoidRootPart

However, the player gets welded to the part, but stays in place as the elevator still moves.

How do I keep the player attached to the elevator as it moves?
The elevator moves with tweens.

1 Like

I recommend you read this post he did a good job making a wall stick/gravity module it might help you out

Uhh an entire wallstick module is unnecessary if he’s only moving a player for a few seconds in an elevator without the need to be standing on the wall.

To the actual post now, you can just use WeldConstraint instead of Weld since it will do the “welding” for you. (Just change Weld in your script to WeldConstraint)

While updating the elevator part’s position though, you have to update CFrame and not position for the player to move with the weld, wiki link here.

EDIT: Just noticed you want the player to be able to move which means you’ll have to probably constantly set the humanoidrootpart’s CFrame position Y value above the elevator part instead with a constant loop as the tween runs or use :GetValue of tweenservice to create a tween function that updates player position with it.

1 Like

May I recommend you try using a WeldConstraint instead of an old Weld. Make sure that you are welding them to the floor of the elevator.

You may want to check out this post which should give some insight on how to achieve your desired result