I’m making a crossy road inspired game and I need help rotating the car so it’s correctly orientated and will look more realistic
here is a video of the problem I’m having
robloxapp-20230628-1259083.wmv (1.3 MB)
I’ve tried using car.PrimaryPart.Orientation = vector3.new(0, 180, 0) but that like makes the whole car invisible for some reason…
Heres the script
local tweenService = game:GetService("TweenService")
local spawner = script.Parent
local Cars = game.ServerStorage.Cars:GetChildren()
function SpawnCar()
local Car = Cars[math.random(1, #Cars)]:Clone()
local slideAmount = 150
Car.PrimaryPart.CFrame = spawner.CFrame
Car.Parent = workspace.Cars
local originalCFrame = Car.PrimaryPart.CFrame
local tweenInfo = TweenInfo.new(
3,
Enum.EasingStyle.Linear,
Enum.EasingDirection.In,
0,
false,
0
)
local tween = tweenService:Create(Car.PrimaryPart, tweenInfo, {CFrame = originalCFrame + Vector3.new(0, 0, slideAmount)})
tween:Play()
tween.Completed:Wait()
Car:Destroy()
end
while true do
spawn(function()
SpawnCar()
end)
wait(math.random(1, 1.5))
end
I hope this isnt a hard fix just like a line or 2 of code but I appreciate any help.
Brant