You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
-
To achieve the model pivot tween to work
-
What is the issue? Include screenshots / videos if possible!
- What solutions have you tried so far? Did you look for solutions on the Creator Hub?
- I’ve looked for solutions online and creator hub.
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!
I have been trying to get this to work for hours now and it still doesn’t wanna work. I’ve looked through online and creator hub but it seems as nothing is working if anyone can help out with this please help.
Im only a year and half into coding and decided I should try to learn tweening more.
local clicker = script.Parent
local model = clicker.Parent
local leftdoor = model.GDoorLeft
local rightdoor = model.GDoorRight
local Opened = clicker.Opened
local debounce = false
local TweenService = game:GetService(“TweenService”)
local tweenInfo = TweenInfo.new(2,Enum.EasingStyle.Circular,Enum.EasingDirection.InOut,0,false,1)
clicker.MouseClick:Connect(function()
if debounce == true then
return
end
if Opened.Value == false then
Opened.Value = true
debounce = true
local leftstart = leftdoor:GetPivot()
local rightstart = rightdoor:GetPivot()
local leftgoal = leftstart + Vector3.new(0, 0, -6)
local rightgoal = rightstart + Vector3.new(0, 0, 6)
local tweenL = TweenService:Create(leftdoor, tweenInfo, {Vector3 = leftgoal})
local tweenR = TweenService:Create(rightdoor, tweenInfo, {Vector3 = rightgoal})
tweenL:Play()
tweenR:Play()
tweenL.Completed:Wait()
tweenR.Completed:Wait()
debounce = false
else
if Opened.Value == true then
Opened.Value = false
debounce = true
local leftstart = leftdoor:GetPivot()
local rightstart = rightdoor:GetPivot()
local leftgoal2 = leftstart + Vector3.new(0, 0, 6)
local rightgoal2 = rightstart + Vector3.new(0, 0, -6)
local tweenL2 = TweenService:Create(leftdoor, tweenInfo, {Vector3 = leftgoal2})
local tweenR2 = TweenService:Create(rightdoor, tweenInfo, {Vector3 = rightgoal2})
tweenL2:Play()
tweenR2:Play()
tweenL2.Completed:Wait()
tweenR2.Completed:Wait()
debounce = false
end
end
end)