I am trying to create a part which tweens to where I click with my mouse while also changing the y axis with another different tween. When this script runs the part only tweens toward my mouse and does not change on the y axis. I am just learning tweens now so any tips would be appreciated as well.
local part =script.Parent
local tweens = game:GetService("TweenService")
local function fire(player, mousepos)
local tweeninfo = TweenInfo.new(3, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out, 0, true, 0)
local tweeninfo2 = TweenInfo.new(6, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0, false, 0)
local tween = tweens:Create(part, tweeninfo, {CFrame =CFrame.new(part.CFrame.X, part.CFrame.Y + 10, part.CFrame.Z)})
local tween2 = tweens:Create(part, tweeninfo2, {CFrame =CFrame.new(mousepos.X, part.CFrame.Y, mousepos.Z})
tween:Play()
tween2:Play()
end
game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(fire)