How do I anchor the player to the part to prevent clipping?

Hello all,

I’m trying to create an elevator for my game, but I’m not sure how to prevent players from clipping through the floor when the TweenService animation plays. (To clarify, I used the TweenService animator plugin.)

I would like to know if there is a way to anchor the player to the part (it is named “Elevator” so the player doesn’t clip, and the script executes the rest of itself before eventually un-anchoring the player.

animator = require(script.Parent.Elevator.Animator)

script.Parent.Button.ClickDetector.MouseClick:Connect(function()
	script.Parent.Button.ClickDetector.MaxActivationDistance = 0
	wait(0.1)
	script.Parent.Elevator.ElevatorWhirr:Play()
	wait(0.1)
	animator.ElevatorDown:Play()
	wait(10)
	script.Parent.Elevator.ElevatorWhirr:Play()
	wait(0.1)
	animator.ElevatorUp:Play()
	script.Parent.Button.ClickDetector.MaxActivationDistance = 32
end)

I’m not 100% sure what to do, as I’m still learning. Can someone give me any pointers on what I can do here?

3 Likes

Try welding the players characters HumanoidRootPart to one of the elevator parts and see if that works.

2 Likes

Where would be a good place to tell the script to weld the HumanoidRootPart to the Elevator part? Would it be placed at the beginning of the script?

Scratch that. It works now, thank you!

1 Like