Snap To Animation Position

So I have seen those games where the player will go to an object and it will play an animation and not allow the player to leave until it is finished and I’m wondering how I get the player into the position for the animations and keep them there. If you could help out it would be appreciated.

The exact thing I need to do is when a player is near enough to this wall and press “E” it will snap them into the animation positions that I have where they stand there then reach into a hole in the wall, pull something out then they are free again.

Player doing their own thing

Player presses “E” and snaps into the position for the animation and it plays

you would manually find the point then just pathfind them to that spot

-- LocalScript
local player = game:GetService("Players").LocalPlayer
local character = player.Character
local anim = -- animation directory here

local function animPlay() -- you trigger this when E is pressed
    character.HumanoidRootPart.CFrame = CFrame.new(Vector3.new(x, y, z))
    character.Humanoid.Walkspeed = 0
    character.Humanoid.JumpHeight = 0
    anim:Play()
end

You might have to tweak some code based on what you want.