After porting to from v2.0.x to v2.1 physics bodies behaves differently

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By lukas
:warning: Old Version Published before Godot 3 was released.

After porting my project from Godot v2.0.3 to Godot v2.1rc a RigidBody2D object is loosing its velocity while moving. In my project I use custom value of default_density parameter.

:bust_in_silhouette: Reply From: lukas

default_density was renamed to default_linear_damp. Changing value of default_linear_damp to the same value as was default_density in Godot v2.0.X project settings solves the issue.
default_density can be removed from engine.cfg.

I think I wrote code to handle setting the new default_linear_damp parameter with the value of default_density though, it didn’t work?

Akien | 2016-07-28 10:08

In my case it didn’t. After opening project in v2.1rc default_linear_damp in project settings was to 0 although default_density was 0.1.

lukas | 2016-07-28 10:24

Ah! Found a typo: Physics2D: Rename default_density to default_linear_damp by akien-mga · Pull Request #5032 · godotengine/godot · GitHub
I got the last parenthesis wrong apparently in the if condition.

Akien | 2016-07-28 10:37

I’ve now fixed the typo so it should behave better hopefully.

I couldn’t reproduce the bug though, for me the value was correctly transfered:

diff --git a/engine.cfg b/engine.cfg
index b04af42..001c5e3 100644
--- a/engine.cfg
+++ b/engine.cfg
@@ -5,4 +5,4 @@ main_scene="res://Node2D.scn"
 
 [physics_2d]
 
-default_density=13.4
+default_linear_damp=13.4

Akien | 2016-07-28 17:02