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.
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.
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.
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.
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.
@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.