0 votes

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.

in Engine by (675 points)

1 Answer

0 votes

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.

by (675 points)

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?

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.

Ah! Found a typo: https://github.com/godotengine/godot/pull/5032/commits/a068152ba08cde6933db6862b9b440d3b5cc00a5
I got the last parenthesis wrong apparently in the if condition.

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
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.