Hello, so I’m currently trying to make a random moving car that you can get on. However, when I tried doing tweenposition I noticed that no physics would occur. So I tried tweening BodyGyro and BodyPosition and the result was just spazzing my vehicle. Going at space or at the void.
Is there any ways I could fix this?
Here’s my script,
local function MoveCar(carbodyposition,carbodygyro,destination)
local tweenInfo = TweenInfo.new(
5, -- Time
Enum.EasingStyle.Linear, -- EasingStyle
Enum.EasingDirection.Out, -- EasingDirection
0, -- RepeatCount (when less than zero the tween will loop indefinitely)
false, -- Reverses (tween will reverse once reaching it's goal)
0 -- DelayTime
)
carbodyposition.MaxForce=Vector3.new(5000,5000,5000)
carbodygyro.MaxTorque=Vector3.new(5000,5000,5000)
tween = TweenService:Create(carbodyposition, tweenInfo, {Position = destination.Position})
tween:Play()
local tweenInfo2 = TweenInfo.new(
5, -- Time
Enum.EasingStyle.Linear, -- EasingStyle
Enum.EasingDirection.Out, -- EasingDirection
0, -- RepeatCount (when less than zero the tween will loop indefinitely)
false, -- Reverses (tween will reverse once reaching it's goal)
0 -- DelayTime
)
local tween2 = TweenService:Create(carbodygyro, tweenInfo2, {CFrame = CFrame.new(destination.Position)})
tween2:Play()
end
Thanks in advance.