Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apply_impulse, add_force sometimes makes the RigidBody fly away. #36703

Open
Tracked by #45333
Anyeos opened this issue Mar 1, 2020 · 3 comments
Open
Tracked by #45333

apply_impulse, add_force sometimes makes the RigidBody fly away. #36703

Anyeos opened this issue Mar 1, 2020 · 3 comments

Comments

@Anyeos
Copy link

Anyeos commented Mar 1, 2020

Godot version:
3.2 release

OS/device including version:
Ubuntu 19.10

Issue description:
I have a FPS game shooting a lot of bullets (instanced, not raycasting) and on the method "do_damage" I apply impulse to a RigidBody when it get hit from bullet.
The problem is that the RigidBody sometimes (and more than sometimes) receive an extreme impulse. An insane one. But when I check the values (printing it to output) the numbers of the impulse and the used offset is correct. So the problem is outside of my gdscript code.

How to reproduce
To reproduce put some box with RigidBody and make a weapon to shoot bullets as KinematicBody. Use move_and_collide on the bullet and apply impulse to the box (only one time) when it hit.

The behaviour occurs too sometimes without the use of apply_impulse.
Make sure to don't let the RigidBody sleep (uncheck "Can Sleep").
Test it only with the box and the bullets. Don't use apply impulse and sometimes the box will fly as if it was impulsed by something. But how? if there are no apply_impulse in any place?

Well, I guess it is some bug on the bullet engine.

@Zireael07
Copy link
Contributor

Sample project needed, otherwise the devs won't be able to check or do anything

@Anyeos
Copy link
Author

Anyeos commented Mar 1, 2020

Ok, but give me some time please. I am making an example FPS with source code included and I will publish it on github.
With that example it is failing. But I need a bit of more time to sort the things and publish it.

For now you can use the official FPS example: https://docs.godotengine.org/en/latest/tutorials/3d/fps_tutorial

Just arrive to the part where you make the boxes a RigidBody to receive hit. And dont forget to use "move_and_collide" for the bullets.

@Anyeos
Copy link
Author

Anyeos commented Mar 18, 2020

I already published the example. You can run it and shoot the boxes. You will notice sometimes that the box fly around as if it was hit with some nuclear bomb or something like that. LOL

Example FPS: https://github.com/Anyeos/Godot-PFPS-ejemplo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants