Tween opening door isnt working

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    Rotate opening door
  2. What is the issue? Include screenshots / videos if possible!
    Seems to be detecting the player hitting the door but not the actual anim
  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    all the parts are welded and there doesn’t seem to be any errors
    After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
local doormodel = game.Workspace.Door1
local leftdoor = doormodel.Left
local sensor1 = doormodel.Sensor
local TS = game:GetService("TweenService")
local LD = leftdoor.PrimaryPart
-- Variables ^^

local LeftDoorInfo = TweenInfo.new()
local LeftDoorSwing = TS:Create(LD, LeftDoorInfo, {
	CFrame = LD.CFrame * CFrame.Angles(0, math.rad(95), 0)
	}) 

sensor1.Touched:Connect(function(hit)
	if not hit.Name == "Humanoid" then return end
	local char = hit.Parent
	wait(1)
	print("player touching door") -- this prints but it spam prints (could be the problem but idk)
	LeftDoorSwing:Play()
end)

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

1 Like

I would try running the tween outside of the .touched event, if it doesnt work I would recommend retracing your steps and follow this tutorial:

you should be making a hinge, and all parts inside the main door model, welded together i.e.

Model->parts heirarchy

primary part should be the hinge

1 Like
  1. I recommend adding an invisible, uncollidable part at the door’s hinge. Then you tween that part.

  2. Weld all the parts together.

  3. Make sure all parts (except the part that is being tweened) are unachored.

  4. Add a Debounce so it doesn’t spam print and spam the command for the animation.

2 Likes

yeah in the video it shows one part (primary) welded to everything which I have and I am 99.99% sure the touched isn’t the problem because I did it without it

1 Like

Show your door model hierarchy and take a picture of the weld constraints visible similar to 5:09 of the video i linked

1 Like

lost it on step three forgot the primary part needs to be anchored thanks :smiley:

1 Like