I noticed when working with vehicles that if I turn off player mass during Studio play tests, things work much better. For one, the car doesn’t slide around or tip over when the player bumps it.
What’s the best way to have make player parts massless at start/load time?
By deactivating player physics, do you mean disabling their collision? If so, just add every player’s limbs and accessories to a CollisionGroup on join that cannot interact with the CollisionGroup containing vehicles.
I can do it when a test game is running in Studio by making the body parts massless. That seems to be the most helpful setting to change. It’s a checkbox in Studio but how do I make that default for all players?
The process of setting every instance’s CollisionGroup within players’ characters is very similar, in your case we need to:
Listen for players joining
Connect a function to players’ CharacterAdded event to execute for all spawns upon entrance to the server
Iterate through every descendant of newly spawned characters and ensure that those inheriting BasePart’s properties are massless
Your code should accomplish something like this:
game:GetService'Players'.PlayerAdded:Connect(function(plr) --listen for players joining
plr.CharacterAdded:Connect(function(chr) --listen for characters spawning
if game:GetService'StarterPlayer'.LoadCharacterAppearance then --only await character model completion if appearances load
plr.CharacterAppearanceLoaded:Wait(); --await character model completion
end
local limbs = chr:GetDescendants();
for i = 1, #limbs do --yay no pairs loop what a great micro optimization
if limbs[i]:IsA'BasePart' then --ensure the object inherits basepart because massless is a property inherited from basepart
limbs[i].Massless = true;
end
end
end)
end)