I’m trying to use TweenService to change a BodyVelocity to the LookVector of a part. The problem is, the Z value isn’t changing despite having an infinite MaxForce. I have used TweenService in the past and never encountered an issue like this, but I’m sure it’s an easy fix.
I have tried using :Lerp(), but I can’t really “cancel” it
local Seat = script.Parent.BoatMain.Drive
local AheadValues = script.Parent.DriveValues.Ahead
local BodyVelocity = Seat.BodyVelocity
local TweenService = game:GetService("TweenService")
local Accelerate = TweenInfo.new(0.1,Enum.EasingStyle.Linear)
local AheadTween = TweenService:Create(BodyVelocity, Accelerate, {Velocity = Seat.CFrame.LookVector * 6})
while true do
if AheadValues.FullAhead.Value == true and EngineRunning == true then
CancelTweens()
wait(0.1)
AheadTween:Play()
end
end
Help would be greatly appreciated