Here is what I tried I have a click detector and what I want to happen is when the click detector is hovered on then the model will move -3
studs on the zed axis. Then when I stop hovering it will move 3
studs on the zed axis back to their original position.
Heres what I tried doesn’t work I kinda overcomplicated it and I’m gonna feel stupid when I fix it;
local function tween_Information(chapter)
local tweenInformation = TweenInfo.new(1, Enum.EasingStyle.Quart, Enum.EasingDirection.Out)
local partProperties = {CFrame = chapter.PrimaryPart.CFrame + Vector3.new(0,0,3)}
local tween = tweenService:Create(chapter.PrimaryPart, tweenInformation, partProperties)
local tweenInformation = TweenInfo.new(2, Enum.EasingStyle.Quart, Enum.EasingDirection.In)
local partProperties = {CFrame = chapter.PrimaryPart.CFrame + Vector3.new(0,0,-3)}
local tween2 = tweenService:Create(chapter.PrimaryPart, tweenInformation, partProperties)
tween5 = tween
tween10 = tween
return tween5, tween10
end
local function hover(chapter)
tween_Information(chapter)
tween10:Pause()
tween5:Play()
end
local function hover_End(chapter)
tween_Information(chapter)
tween5:Pause()
tween10:Play()
end
workspace.Chapter1.Interactable.ClickDetector.MouseHoverEnter:Connect(function()
if not debounce then
debounce = true
hover(workspace.Chapter1)
debounce = false
end
end)
workspace.Chapter1.Interactable.ClickDetector.MouseHoverLeave:Connect(function()
if not debounce then
debounce = true
hover_End(workspace.Chapter1)
debounce = false
end
end)