Smooth opening door, how will IT get smooth?

Hello Developer, i have Made a Candy House for my Christmas Game. You can get inside the House (actually you get teleported in to a bigger room) but ITS difficult to Script a door that opens itslef If the Player IS nearby (Doors opens Like in adopt me). I already hast Made a hitbox, but have No idear how to make a smooth opening door. Can anybody explain IT to me?

use tweenservice to smoothly make the doors slide/open

1 Like

Use an event to detect when a user touches the detector/hitbox. Every part has a Touched event that fires when something touches it. You can connect to this event to run a function when it fires.

part.Touched:Connect(function(otherPart)

end)

Use TweenService to move the door inside this function.

local TweenService = game:GetService("TweenService")

local goal = {}
goal.Position = Vector3.new(50, 10, 0)

local tweenInfo = TweenInfo.new(10, Enum.EasingStyle.Linear)

local tween = TweenService:Create(part, tweenInfo, goal)

tween:Play()
1 Like