How do I prevent rides from glitching?

Hi, I’m trying to make a Theme Park game, and I do not want to use CFrame or make the rollercoasters super smooth for numerous reasons, the biggest reason is I want it to be realistic, where you can see the rough spots of rides, similar to how you can in real life but instead of seeing, you feel it.

The issue I’m facing is people being able to freeze the rides.
It’s kind of hard to explain when writing it, so I’ll just show you.

In this video, I sat in the ride vehicle, it does not matter the seat. I made sure that I was not in full screen, and once the train started moving, I clicked and held my mouse down on that X button as if I were going to close the tab, but moved my mouse a few seconds later, then let go, and it froze the game.

My first thought was “Oh, this might be something to do with the server setting the network owner to the player”, so I wrote this script below…

local t1 = game.ReplicatedStorage.HyperCoasterTrain1:Clone()
local t2 = game.ReplicatedStorage.HyperCoasterTrain2:Clone()
t1.Parent = workspace["Strattle Launch"]
t2.Parent = workspace["Strattle Launch"]

for i,v in pairs(t1:GetDescendants()) do
	if v:IsA("BasePart") or v:IsA("Seat") or v:IsA("Part") or v:IsA("UnionOperation") and v.Anchored == false then
		v:SetNetworkOwner()
		
	end
	v.Changed:Connect(function()
		print(v:GetNetworkOwner())
	end)
end

for i,v in pairs(t2:GetDescendants()) do 
	if v:IsA("BasePart") or v:IsA("Seat") or v:IsA("Part") or v:IsA("UnionOperation") and v.Anchored == false then
		v:SetNetworkOwner()
	end
end

I have no errors, no lag no issues with this code, other then this issue still happens.

I have set the PhysicsSteppingMethod to Fixed as that’s what Gemini suggested when I researched for other people experiencing this issue. I don’t want people being able to break the rides just by doing a simple glitch Roblox could fix.

The issue also happens even when I haven’t sat in the vehicle yet, so I don’t know why the networkowner is being set to the player. The reason why the front of the car is still stuck to the track is because I welded it because sometimes Roblox’s physics wouldn’t render the part as ontop of it or whatever.

To show you that it does work, and that it is using a Roblox glitch (no exploit), here’s how it looks when I don’t do the glitch.

Any help is appreciated, if more information is needed, let me know. :smiley:

1 Like