Godot 3.0, animating rigidbody in kinematic mode don't return linear velocity

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By icqqq

In Godot 2.1.4, if I move a rigidbody in kinematic mode,
I can query its linear velocity in GDScript by calling get_linear_velocity

But now in Godot 3, I get zero vector by calling get_linear_velocity
So how can I get linear velocity if the rigidbody is moved by animationplayer?

:bust_in_silhouette: Reply From: DodoIta

I’m not sure, but that’s probably because in Godot 3 you access properties directly, so try:

$YourBody.linear_velocity

Again, I’m not sure, maybe it’s a silly thing like this one :slight_smile:

the problem is that getting linear velocity value is not correctly updated when RigidBody with Kinematic mode is moving by AnimationPlayer
It’s also reported on github and seems a bug.
animating rigidbody in kinematic mode don't return linear velocity · Issue #16451 · godotengine/godot · GitHub

@icqqq you can try different physics engine at Project Settings > General > Physics > 3d > Physics Engine

volzhs | 2018-02-07 15:33