0 votes

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?

in Engine by (249 points)

1 Answer

0 votes

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 :)

by (567 points)

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.
https://github.com/godotengine/godot/issues/16451

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

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 [email protected] with your username.