New Physical Properties becoming DEFAULT next week

Update: Feb 10 - 9:40am This is now live!
Update: Feb 2 - 11:38am We are pushing the date back to Feb 10th to give people more time to migrate and test their games. Please let me know if you experience any issues.
Update: Feb 1 - 12:09pm We are investigating some potentially interesting behavior with high-mass ratios introduced by the changes to density. Currently investigating, but based on our findings we may delay the roll out of making this feature default. Keep checking for updates.

Troubleshooting If Your Game Behaves Unexpectedly

https://devforum.roblox.com/uploads/default/original/2X/6/6f20950b2a9dae3f47ba10837d9679dd43240d5d.png
  1. Your characters feel like they have too much momentum, and take a while to speed up and slow down:
    Check what materials you are using on your floor objects. Are they slippery like Glass or Ice? You may want to modify the frictional properties of these objects to make them more sticky (higher number).

  2. Your Zero-Gravity parts or missiles propelled by BodyForces, BodyVelocities, or BodyGyro’s behaving incorrectly:
    Verify what material they are now, as these objects are likely to have different masses. You may need to re-tune BodyForces.

  3. Some of your mechanisms have gained a weird vibration and erratic behavior:
    Are your mechanisms combining heavy materials with lighter materials? Hinges and Motors joining objects with huge mass differences may have behavioral issues. If you have a metal-chassis car with small plastic wheels you may experience some problems. Try to decrease the density of the car!

IF ALL ELSE FAILS TRY THE FOLLOWING SCRIPTS:
Copy and paste one of these scripts into the “Command” window of your Studio. They will recursively crawl through your game (including all the storage containers) and convert your Physical Properties.
Script 1: Set ALL Densities to 1 (does not include things you load it from assets dynamically)

function recursiveSetAllDensityToOne(instance)
	if instance:IsA("BasePart") then
		-- See if this is a CUSTOM Physics part already
		if instance.CustomPhysicalProperties then
			local oldProp = instance.CustomPhysicalProperties			
			local physicalProp = PhysicalProperties.new(1, 	oldProp.Friction, 
																oldProp.Elasticity, 
																oldProp.FrictionWeight, 
																oldProp.ElasticityWeight)
			instance.CustomPhysicalProperties = physicalProp
		else
			local oldProp = PhysicalProperties.new(instance.Material)		
			local physicalProp = PhysicalProperties.new(1, 	oldProp.Friction, 
																oldProp.Elasticity, 
																oldProp.FrictionWeight, 
																oldProp.ElasticityWeight)
			instance.CustomPhysicalProperties = physicalProp	
		end
	end
	
	for i,v in pairs(instance:GetChildren()) do
		pcall( function()recursiveSetAllDensityToOne(v) end)
	end
end

recursiveSetAllDensityToOne(game)

Script 2: Set any non-Custom parts to OLD defaults.

function recursiveSetDefaultsToDefault(instance)
	if instance:IsA("BasePart") then
		-- See if this is a CUSTOM Physics part already
		if instance.CustomPhysicalProperties then
			local oldProp = instance.CustomPhysicalProperties			
			local physicalProp = PhysicalProperties.new(1, 	oldProp.Friction, 
																oldProp.Elasticity, 
																oldProp.FrictionWeight, 
																oldProp.ElasticityWeight)
			instance.CustomPhysicalProperties = physicalProp
		else
			local physicalProp = PhysicalProperties.new(1, 	0.3, 
																0.5, 
																1, 
																1)
			instance.CustomPhysicalProperties = physicalProp	
		end
	end
	
	
	for i,v in pairs(instance:GetChildren()) do
		pcall( function()recursiveSetDefaultsToDefault(v) end)
	end
end

recursiveSetDefaultsToDefault(game)

See thread for feature description: LIVE - Upcoming Physical Properties and PartMaterial Changes

Starting Wednesday morning (around 9:00 am PST), Feburary 10th, 2016 the new Physical Properties mode will be considered default. This means that people who haven’t already converted their Workspace.PhysicalPropertiesMode to New or Legacy may experience slight changes in part mass, friction and elasticity. We expect most games to be unaffected, but want our developers to be aware.

If physics is an important feature of your game, please test your games ahead of time by switching to “New” on this Workspace property. If you find that this mode causes problems, please switch the mode to “Legacy” to avoid problems and immediately notify us (in this thread if you have access!).

FURTHER READING
Details

  • Humanoid to Object friction used to be calculated completely based on the Object the humanoid was standing on. Now, humanoid feet are treated as plastic, making slippery surfaces less slippery, and stick surfaces less sticky.
  • We attempt to migrate any parts that have non-default friction and elasticity to behave the same away in the new system (see Migration Logic for more info).
  • Buoyancy is now less extreme, the old system had a math bug which was now corrected.

Migration Details

  • We attempt to migrate all parts when the new Physical Properties system is enabled.
  • If your part had Friction that wasn’t 0.3, or Elasticity that wasn’t 0.5 we attempt to migrate this part.
  • If your part already has CustomPhysicalMaterials enabled, we assume that you migrated manually and do not migrate this part again.
  • Migration entails taking your Friction and Elasticity values and applying them into the new system, but keeping the Material’s default density.
  • Any parts that had default Friction and Elasticity values (0.3, and 0.5 respectively) will assume the physical properties of the material.

Please Note: Switching to “Legacy” should not be considered a final solution, as “Legacy” mode will become unavailable within the next few months once this feature reaches Phase 3.

11 Likes

When is PGS going default?

4 Likes

When the new properties are default, more than likely. I wouldn’t see them supporting the legacy physics engine with the new properties, and only the new physics engine.

May I inform my non-RBXDev friends of this coming change?

1 Like

Yes. It’s in Public Updates and Announcements

1 Like

As Echo said, yes. I’m going to put out a notification in Studio that links to this thread on Monday.

2 Likes

Just wanted to verify, thanks.

1 Like

You should be able to just give them the link to this thread. Threads in Public Updates and Announcements should be visible to everyone.

4 Likes

I’ve added details about the “Migration Logic” to the first post.

2 Likes

Are the changes described in the blog going to be added?
I had some gripes with the current system that I posted here a few months ago that’d make me stay on Legacy until more API is added

I’m not sure what you mean by the changes described in the blog. Which changes specifically?

I’m adding the ability to call PhysicalProperties.new(Enum.Material.X) as we speak. So if you wanted to modify JUST the elasticity to 0, you could do something like this:

tempProp = PhysicalProperties.new(part.Material)
part.CustomPhysicalProperties = PhysicalProperties.new(tempProp.Density, tempProp.Friction, 0, tempProp.FrictionWeight, tempProp.ElasticityWeight)

Please note that being “Legacy” is only a temporary solution. Phase 3 of the migration converts ALL places to the new system.

3 Likes

Are you going to provide any tools for people who want to change properties but don’t know how to Lua?

What do you mean? The Studio UI is fully functional for customization.

2 Likes

I remember seeing that when it launched, but I’m not seeing it anymore:

I’m using an unmodded, up-to-date version of studio. Version 0.228.0.68457 to be exact

Did you change your Workspace.PhysicalPropertiesMode to New? It won’t be the default until Next Wednesday.

3 Likes

Any material settings that are just like the old system? This breaks like 4 or 5 of my games lol

1 Like

Can you elaborate on how this breaks your games? Which games it breaks? Is it because of Friction, Elasticity, or Density (Mass) changes?

If the automated migration logic didn’t change help you, this probably means your issue is Density. You can try going through all parts in a script and setting it’s PhysicalProperties to all have a Density of 1.

2 Likes

Yeah that might be the issue Im having…

1 Like

I would just like to say this update is the best! The Density Property is so useful for my game. Here is some issues it has completely solved for me.

  1. Puck flinging. The puck being a 1x.4x1 part, caused it to be flung if struck by turning player or Foot. Solution: set the puck’s density to 30, no more Flings!

  2. Player to Player collisions sending a player flying. When you skate right in front of a another player’s path, he is gonna send you sailing down the Ice. Solution: Locally set all Other players part’s Density to .02, so now when you walk into another player’s path, it only gives you a slight nudge.

Yes, it took me about and hour to fix the issue it caused to my Ice’s friction and Player’s skating, but in the end it was extremely worth the switch to the New Physical Properties.

1 Like

That sounds promising. Link?