Parts move slowly when not interacting with players

-I made a gondola ski lift game that has multiple cabins continuously moving. They are hanging onto cables, and the cables are actually conveyor belts that push them around. The gondolas are optimized so they dont slide on the conveyor belts just like that, as the belts have maximum friction, and so do the cable car “arms”

-The problem is that, when i launched the game on roblox and played it, the gondolas move slower than they should, but not only that, when you sit inside one of the seats inside a gondola, just that one stops lagging, and speeds up to normal speeds. The issue is that it catches up to the other gondolas in front of it, and that should not happen.

-So far, i tried to mess with the grip of the conveyor belts, i tried to fidget with the streaming, changing its modes, disabling it as well. It barely did a difference. I also considered getting a non-roblox type of seat, but i think that the issue here is actually the fact that the player is welded directly to the gondola when seated.

Is there a way to make roblox to either prioritize the movement of ALL the gondolas, like you were seating in them, OR, stop roblox from doing that with ANY of them, including the one you sit in. As long as they are all moving at the same speed and dont catch up to eachother, ill consider it a solution.

*Note: i have no experience in scripting whatsoever, and besides, the point of this game is to use roblox’s physics engine to the fullest. The only scripts are the ones for the conveyor belts, and the regen button at the bottom station that resets the entire cableway (in case that one of the cabins clip or gets stuck, the button resets them all).

Here is the game if you want to test it yourself: SunnBerg Mountain Funitel Cable car - Roblox

Here you can see what is going on more clearly:

All help is appreciated. Even if this post is a few years old, feel free to comment your idea as well

1 Like

Removing the mass of your character could be a way from preventing the player from messing with the cable car

This script would go inside of StarterCharacterScripts:

task.wait(1) --This is optional

local Character = script.Parent
local HumanoidRootPart = script.Parent:WaitForChild("HumanoidRootPart")

local function RemoveMass()
	
	local Descendants = Character:GetDescendants()
	
	for _, Part in pairs(Descendants) do
		if Part:IsA("BasePart") then
			Part.Massless = true
		end
	end
	
end

RemoveMass()
1 Like

Thanks for your help, this seems to have solved the swinging and balance issue, but im still trying to figure out something for the speed issue. im sure its something about server to client communication, as the entire game seems sluggish when i play it. I also have another larger game, and it does not seem to have these issues. i checked for background scripts or something, but there isnt much. ill keep searching my game and trying alternatives

Did you try SetNetworkOwnership?

I’ve heard about it, but didn’t understand how i can interfere with it, and which options to select for best physics behaviour

Use server for same movement across all servers, use client for fluid movement.

so… how do i change it? i suppose it is a script?

Because your cable car doesn’t depend on user input, you could try making it server owned by calling SetNetworkOwner(nil) on one of its parts.

You can try this by putting this script inside a Part of your gondola:

-- Script should be in an unanchored Part of the gondola
local part = script.Parent
-- Wait to be able to set the network ownership
while not part:CanSetNetworkOwnership() do
task.wait(1)
end
-- Set the network ownership to the server (turns off automatically decided network ownership)
part:SetNetworkOwnership(nil)

(Cool use of physics by the way!)


When you sit in a seat, I bet the server assigns network ownership to the player for the gondola. Because the client is simulating the gondola, it might get higher simulation resolution, meaning that the arms are aligned with the belts more often, resulting in more speed.

i tried putting the script in one of the gondola parts (the floor), but it still didnt really have any effect, maybe i put it somewhere wrong (the gondolas are made out of multiple groups, which then have the parts themselves inside). The thing is that, i have another game called “lone peak mountain resort”, which runs on almost the same concept, the difference being that you spawn your cable car, you get in it, it goes to the top, and it stops there. I never encountered something like this issue before. I wonder how other games make it so their cable cars keep running smoothly. i think the reason for the lag back in this game is all the moving parts at the same time or something. I still wonder if there is a way to simulate them all just like you were sitting in them

If you put the script inside any part (i.e. a wedge, glass piece, pillar, etc) that’s part-of/welded-to the moving gondola it should have worked.

You can also try this version with a print statement:

-- Script should be in an unanchored Part of the gondola
local part = script.Parent
-- Wait to be able to set the network ownership
while not part:CanSetNetworkOwnership() do
task.wait(1)
end
-- Set the network ownership to the server (turns off automatically decided network ownership)
part:SetNetworkOwnership(nil)
print("Network ownership changed successfully!")

That’s weird it didn’t change anything.

Roblox has some debugging tools you might be interested in. The problem might be from adaptive time stepping, but I’m not sure if Roblox considers where the player is located for that.

Debugging Visualization

During testing, it may be useful to visualize frequencies for simulated parts. To enable this option:

  1. Open the Studio settings window (File ⟩ Studio Settings).

  2. From the Physics tab, enable Are Timesteps Shown.

Once enabled, simulated parts will be outlined by their current simulation rate. If a part stops being simulated, either via the sleep system or a network ownership change, the part will no longer be outlined.

I would look into the following visualizations:

  • Are Timesteps Shown
  • Are Owners Shown
  • (Maybe) Is Interpolation Throttling Shown

I would look for what states the gondola behaves as intended (e.g. starts working when ownership moves to client (indicated by a green outline), etc).

from what i have noticed, i seen that the entire game seems to be more sluggish. The flywheels which are purely decorational, at the stations, and that are spun around by hinge constraint motors seem to move slower… i also want to try and find the source of the lag, and if it still persists, ill try to make the seats not be directly welded to the cable car, but attached in another way, or maybe remove them until i figure something out… maybe that could work, but ill still wait, maybe i can get one of the scripts working, or another solution will appear…

and also i discovered this while playing it on roblox, and opened the console. And, if i leave the game running for quite a while, things seem to kind of level out, but there are still occasional server “lag” spikes or what they are

upon further playing, i realised the lag is only in the lower and mid part of the map, so it might also be something about part count or rendering or something

1 Like

So, I’m not the best guy to ask as far as exactly how to fix this, but I can steer you in the right direction at least.

This is literally the definition of disaster. The Roblox physics engine is a very complex thing, and the more you do to it, the worse your game will run. Your goal should be to try taking more things off of the physics engine where you can.

You said this didn’t make a difference for you. That is actually mostly expected. When no player is near or on board the cable cars, they are owned and operated by the server. The server, having to make all of these calculations alone, is going to struggle and your cars may move slower because of it. When a player comes by, the car they’re on automatically gets owned by them, which means their own computer takes over the physics. Since the server is running 20 cable cars, and the player is running 1, they have a better time with the calculations, hence why their car goes faster. When you set the network owner to nil (as the script you were shown does) it will force the cable cars to be operated by the server regardless of player interaction. So, they won’t speed up automatically, all it will do is prevent them from changing speed when players board them.

I feel bad for saying this, because I know you mentioned that you are not a scripter, but using hinge motors for decorative parts that don’t need them is a great way to lag a game. The wheels (which look awesome, by the way) can be animated on the client, which will reduce lag. Something else you could do is have a simple script that manually changes the CFrame in a loop to make them rotate while being anchored. The problem with the CFrame method is that it will eat up some resources on the scripting end, but if your game has basically nothing happening script wise, this won’t matter.

I should ask, how exactly are you moving the cable cars? Are they on motorized hinges, or are they riding on top of conveyor belt parts, or something else?

1 Like

sorry for the late response (irl activity), the cable cars are on normal hinges (no actuator), and they have springs that dampen their swinging. They are hanging on cables (which are conveyor belts) and they are pushed around in a loop
image
I am wondering if there is a way to make the cable cars be either all owned by the client, or all of them to be owned by the server. even if they are all sluggish or not, they will move at the same speed, and no gondola will catch up with any other one


This was mentioned by myself and someone else above. All you need to do is have a script inside of a part somewhere within each cable car model that sets the network owner of said part (which automatically sets the whole rig) to nil.

script.Parent:SetNetworkOwner(nil)
script:Destroy()

Paste that into a server script inside of a part of each car, and they will all be server owned.