(using a-chassis by nvna)
Hey, I’m trying to make a system where when the car goes out of bounds (touches the baseplate) it tweens back to the start of the track, but it keeps giving me this error:
“TweenService:Create property named ‘Origin’ on object ‘Car’ is not a data type that can be tweened”
local baseplate = script.Parent
local tweenservice = game:GetService("TweenService")
baseplate.Touched:Connect(function(hit)
if not hit.Parent:FindFirstChildOfClass("Humanoid") then -- detects if its a car touching or a player
local car = hit.Parent.Parent -- find the car model
for i,v in car:GetDescendants() do -- anchors all parts
if v:IsA("BasePart") then
v.Anchored = true
end
end
local Tweeninfo = TweenInfo.new(5,Enum.EasingStyle.Exponential,Enum.EasingDirection.In) -- tween settings
local Tween = tweenservice:Create(car,Tweeninfo,{Origin = workspace.Map.Start.CFrame})
Tween:Play()
Tween.Completed:Wait()
for i,v in car:GetDescendants() do -- unanchors all parts
if v:IsA("BasePart") then
v.Anchored = false
end
end
end
end)
and now I dont know what to do, Anything helps