system
June 15, 2017, 1:11am
1
system
June 15, 2017, 2:59am
4
Reply From:
quinno
No. apply_impulse is like poking the object, you can make it spin/rotate but you’re always going to impart thrust too.
Godot 3.0 only (I think): If you implement the _integrate_forces virtual method, you can call apply_torque_impulse on the state object. This should do what you want. see: http://docs.godotengine.org/en/latest/classes/class_rigidbody.html#class-rigidbody-integrate-forces
You could attach the body to a joint (to allow it to rotate only) if you want no movement at all.
Worst case, you can set the linear/angular velocity manually.
Worst case, you can set the linear/angular velocity manually.
This is what I am trying to avoid, I asked this because there was no function like ‘set_applied_torque’ like its 2D counterpart has.
Thanks anyway, one more reason to be hyped for 3.0.
Mudley | 2017-06-15 03:24
system
June 17, 2017, 10:38am
5
Reply From:
wombatstampede
I posted a sample project in the forum which does this (in godot 2.1.3):
https://godotdevelopers.org/forum/discussion/18480/godot-3d-vector-physics-cheat-sheet
In short:
You need to apply impulses on both “ends” in opposite directions. And you should wait a short time (i.e. 0.1sec) after start for physics to settle down before applying impulses.