As seen below there is some kind of lag that only happens after the car respawns and then starts driving. I thought the wheels where stuck to the ground at first, but it doesn’t matter how high the respawn is, it always glitches. This is a very big issue for what the program is supposed to accomplish.
It’s difficult to see on this quality format, but the best description I can give is that the screen freezes for a short duration. Possibly the wheels that are not caught up with the car somehow?
Oh, my bad! I meant that u fire a function and it will make it equal to the default camera, making it glitch if right, try adding below the cc.CFrame = carCam.CFrame this;
if cc.CFrame == carCam.CFrame then --add this when fired function
cc.CFrame:Destroy() --dont forget to add the end
Do you use StreamingEnabled? It could be that the wheels get stuck in an unloaded chunk after resetting that takes a second to load in again once you respawn, since I assume you’re relying on constraints for the wheels (physics based chassis?).
You could maybe try anchoring all descendants of the chassis and then teleport the car to the player using PivotTo before unanchoring the descendants again. Not sure if that’d work but it’s worth a try.
The camera itself seems to be fine, it seems to be the car itself taking time to “start up” after teleporting.
the “taking a while to start up” is a part of the system so that’s fine. It’s true that it doesn’t glitch when the car is teleported the first time, which is confusing because it is the same function I am using “carModel:PivotTo(area.CFrame)”.
I could try to unseat the player and try to simulate the starting of the game, instead of trying to simulate a respawn? I really don’t know why it would behave differently from the same method of teleporting.
I don’t know much about Roblox cars system. I don’t think there is a chassis in this model. 4 wheels parented to the car model itself and a vehicleseat seems to be then only car functions here? The wheels have 2 welds inside them.
edit: I’ll be back with results of experimenting tommorow
After some testing: It is a time based glitch. By increasing the respawn time, the glitch doesn’t happen. However this sacrifices gameplay obviously (long respawn time is bad), so if anyone can figure out why the function has to be run at least 3 seconds later instead of the normal 1,5 seconds, it would be greatly appreciated.
Below is the code that triggers when the “race” starts. The 2nd function runs first - in the bottom of it you can see the task.wait() that determines the respawn time of the car. Setting it to anything lower than 3 seconds will cause the glitch to happen.
local function timeOn()
local time = os.clock()
isRacing.Value = true
timer = game["Run Service"].Heartbeat:Connect(function()
local finished = finish:GetAttribute("finished")
local raceTime = showDecimals((os.clock() - time),2)
remoteTimerEvent:FireAllClients(raceTime)
timeValue.Value = raceTime
if finished == true then
print(timeValue.Value)
timer:Disconnect()
end
end)
end
respawnBindable.Event:Connect(function()
if timer then
timer:Disconnect()
end
isRacing.Value = false
timeValue.Value = 0
finish:SetAttribute("finished",false)
remoteTimerEvent:FireAllClients()
task.wait(3) --the respawn time
timeOn()
end)
same results
Car glitches out. Something I should mention is that the respawn teleport teleports a different place with the same function (like 3 studs above the start location) playerCar:PivotTo(game.Workspace.start.startArea.CFrame)
it’s very odd