Hello and thank you for coming, here is my problem;
I am trying to rotate a model off their primary part but it is not seeming to work, only rotating the primary part.
-- Variables
local TweenService = game:GetService("TweenService")
local CollecitonService = game:GetService("CollectionService")
-- Doors
for _, door in CollecitonService:GetTagged("Door") do
local insideDoor = door:FindFirstChild("InsideDoor")
local doorHitBox = door:FindFirstChild("DoorHitBox")
if doorHitBox and insideDoor then
if insideDoor.Door:IsA("BasePart") then
door.DoorHitBox.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
-- Opening
TweenService:Create(insideDoor.PrimaryPart, TweenInfo.new(0.7, Enum.EasingStyle.Bounce, Enum.EasingDirection.Out), {Origin = insideDoor.Hinge.CFrame * CFrame.Angles(0, math.rad(120), 0)}):Play()
end
end)
end
end
end
Thank you again for your help!