Teleporting complex vehicles gets them destroyed

Hi All,

I am making a racing game and so far I have been working on the race, checkpoints and rewarding, etc. the whole race loop and just using the most basic JEEP car model
https://www.roblox.com/library/290307816/Jeep
for testing the race on a short temporary track.

I have invisible killzones around the test track and the players who fall out get teleported back to the previous checkpoint they passed.
They can also reset with the R button which does the same. Just puts them back to the last checkpoint passed.
This all works perfectly with the JEEP.

Now I started experimenting with better vehicle chassis as I want to have many different vehicles, which drive in different ways.
I have tried these:
https://www.roblox.com/library/759112322/SS6-Build-L025-SUSPENSION
https://www.roblox.com/library/1795255728/Chassis
https://www.roblox.com/library/5181235975/A-Chassis-6-C-Version-1-4

Found a tutorial https://www.youtube.com/watch?v=tuozArg6JOo using this next one:
https://www.roblox.com/library/4847373180/CarChassis

The problem is that all of these more complex vehicles/chassis BLOW UP! when I teleport them back to the checkpoint.

Can this be solved?
Is there a proper way to teleport complex vehicles?

I could probably solve it by destroying the vehicle and only teleporting the player back to the checkpoint and creating another instance of the same vehicle next to him, from ServerStorage, but that is a bit forced.
Or maybe I don’t need this teleporting at all. I could just disqualify the player who falls out of the track and send them back to the lobby right away.
Is this the way, going outside the track or falling into a lava pit, etc. is handled in most racing games?
I know one game where the player is allowed to jump out of the vehicle but is instantly disqualified back to lobby if he does jump out.

Any suggestions?
Thanks in advance!

3 Likes

Is it a matter of fact that these complex models are properly welded and scripted to the same quality as the Jeep? I’ve certainly seen complex vehicle movements in games. Have you tried un seating the player, then teleporting both car and player, with the player a few studs from the seat? Perhaps enabling/disabling collision groups would help with that as well. Did you make these chassis? Or they are made by others? Sometimes it’s a matter of compatibility to scripting methods as well.

There is a good summary of vehicle types here:
https://devforum.roblox.com/t/is-anyone-able-to-help-me-understand-vehicles/182612/7

The Jeep that works is a basic sliding type and the ones that get all messed up when teleporting are, I guess rolling suspension types.

I did not make them.

Thanks for the suggestion. I’ll try unseating the player and teleporting vehicle and him separately.

Have you considered teleporting the vehicle and player separately? These are two different rigs, after all.

Also, what method are you calling to move the vehicle? In my experience, some of them are known to break my constraint based chassis.

Thanks for the suggestion.
I tried it.
Made the player jump out of the seat, before teleporting them (car and player) separately.
The player arrives nicely, but the vehicle still goes glitching around and flies away.

I am simply using CFrame to give them another position.
This works with the basic Jeep model https://www.roblox.com/library/290307816/Jeep but not with A-Chassis 6.52S2.

vehicleSeat.CFrame = CFrame.new((checkpointSpawnToTeleportTo.Position) + Vector3.new(0,5,0), spawnFacingPosition)

What other ways are there to “teleport” vehicles?

Hey, in the past, when I tried to teleport the player using a part of it, it destroyed it. Maybe try to use :MoveTo() with the model.

Something like this:

CarModel:MoveTo(CFrame.new((checkpointSpawnToTeleportTo.Position) + Vector3.new(0,5,0), spawnFacingPosition))

However, I am not sure if it works with CFrame, try with Vector3 too just in case.

I think the problem is you on how you set the position of the model. You might be doing:

Model.PrimaryPart.Position = Vector3
--or
for i, v in ipairs(Model:GetDescendants()) do
if v:IsA("Part") then v.Position = Vector3 end
end

which is wrong

You can use the Model:SetPrimaryPartCFrame(CFrame) method.

There are also several constraints that get destoryed when moved. Try looking.

That’s how he moves it.

SetPrimaryPartCFrame() is also a good way to do such a thing as you said, but only if primary part is set.

However, in the car model there might be other models (more models in the model). And there isn’t always a specific part in the first model. I am not sure if you can select primary from other models in your model.

Worth testing out and trying.

@purbanics, @LightningLion58, I believe the issue is that in the initialise script it doesn’t use WeldConstraints, only standard welds that are kinda useless. Your CFrame comment looks correct to me.

If I’m wrong please do say, because I’m also having the breakage issue.

I have the same problem here trying to teleport the A-Chassis vehicles. They start flying away then get destroyed. Anyone has found a solution?

You can attempt parenting the model to lighting, and then using Model:PivotTo() to move the model, and then re-parent it to workspace after.