+1 vote

Hi,

I want to do a top view 2d race car game (like Micro Machines on Sega MegaDrive).
The car is a RigidBody2D and I use setappliedforce to make it move, I also want to use setappliedtorque to make it turn, but it does not do anything.
My RigidBody2D is in rigid mode so it should allow rotation and it works when I use setangularvelocity.
I also tried with various value of angular damp.

Why would setappliedtorque not rotate my RigidBody2D ?

Maybe there is a better way to make the physic of a car (this is the first time I try to make this).

in Engine by (31 points)

1 Answer

+5 votes

I finally found the answer concerning set_applied_torque not working on my RigidBody2D.

Apparently the function set_applied_torque only works if there is a collision shape as a child of the RigidBody2D. ( https://github.com/godotengine/godot/issues/4439 )
After adding the collision shape it works just fine.

by (31 points)

In addition, the larger the collision shape, the slower the torque movement. This is strange.

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 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.