0 votes

In fixed_update on a RigidBody2D I am applying two impulses, in opposite directions at opposite ends, to make the object spin:

apply_impulse(Vector2(100,0), Vector2(0,-100*delta)) apply_impulse(Vector2(-100,0), Vector2(0,100*delta))

For some reason this isn't rotating my RigidBody2D - and if I comment out one or the other the body simply moves straight up and down, with no rotation imparted. I must be missing something obvious - do you need to do anything special to get RigidBody2D to rotate in response to force/impulse? Thanks in advance.

in Engine by (103 points)
edited by

1 Answer

0 votes
Best answer

Figured it out - my RigidBody didn't have a collision shape child node. Adding a collision shape child node resulted in the expected behavior.

by (103 points)
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.