This site is currently in read-only mode during migration to a new platform.
You cannot post questions, answers or comments, as they would be lost during the migration otherwise.
0 votes

Maybe it is a dumb question but anyways...

I habe a object (a) that fallows another object (b).
If object (a) collides with object (b), then no angle velocity shall be applied to (a).
Im using following code snipped of (a):

func _integrate_forces(state):
   var lv = state.get_linear_velocity()
   var vel = lv.length()
   var cc = get_closest_character()
   var t = state.get_transform()
   var step = state.get_step()



The last code line does not work.
Either state.set_angular_velocity(-state.get_angular_velocity()) gives a good result.

A help would be appreciated.

in Engine by (16 points)

That seem counter-intuitive indeed, maybe it's a bug. I would not expect angular velocity to behave differently than linear velocity :|

It could be a bug or some collision force that is applied and not in the center.

Try putting it on character mode, should stop any rotation.

If bodies are like floating (no gravity), may need to be heavier too or have a bigger angular damp.

No bounce and high friction between bodies may help too.

1 Answer

0 votes

putting it on character mode

That helped! Thanks.
Maybe I should read the Documentation better.

by (16 points)
edited by

A angular velocity is still applied with ridig/kimatic body, while having custom integration on.
Its was like I miss a delta time where the angular velocity is processed/applied without my knowledge.

Thanks again.

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.