So basically i was working on this drift cam but i have this problem where it randomly starts showing stuff infront of the car.
Example : https://gyazo.com/19dcda35a8b61b28636bc3f24df2af3e
So it starts behind the car and then when i drift it shows everything infront of the car and not the car itself
Code:
function useCustomCamera()
Camera.CameraType = Enum.CameraType.Scriptable
local tweenToPart = Instance.new("Part")
tweenToPart.Parent = car.Body
tweenToPart.Anchored = true
local vehicleSpeed = returnSpeed().speed
Camera.FieldOfView = 70 + (1*vehicleSpeed)
local runEvent
runEvent = game:GetService("RunService").RenderStepped:Connect(function()
tweenToPart.CFrame = car.PrimaryPart.CFrame + Vector3.new(-20,7,0)
Camera.CFrame = tweenToPart.CFrame
if not customCam then
runEvent:Disconnect()
end
end)
end