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

Document new "infinite_inertia" parameter in KinematicBody/KinematicBody2D APIs #24229

Closed
letsgamedev opened this issue Dec 8, 2018 · 7 comments

Comments

@letsgamedev
Copy link

Godot version:
Nightly Alpha Build December 3. 2018

OS/device including version:
MacOS 10.14.1

Issue description:
I want to shoot a stone (KinematicBody2D) and it should stop on a collision detection. So I use
var coll = self.move_and_collide(direction * speed * delta)
If coll is not null a collision is detected and I change the speed of the stone to 0.
This detections works well for StaticBody and KinematicBody but not for RigidBody.

The stone interacts with the RigidBody, pushing it around and so on but move_and_collide returns no Collision Object at all.

Minimal reproduction project:
body_no_stop.zip

@bojidar-bg
Copy link
Contributor

Can confirm using the given example.

Seems like a regression from 3.0.6, as it works fine there.

@bojidar-bg
Copy link
Contributor

Bisected:

git bisect start **{physic,object,collision}*.{cpp,h}
# good: [9bd402698cfa299b79b9144f8d7744c308a4e085] Bump version to 3.0-stable \o/
git bisect good 9bd402698cfa299b79b9144f8d7744c308a4e085
# bad: [9a8569d434107e721f5c7de0bf8ffe6471367d28] Merge pull request #24155 from akien-mga/scons-msvc-bits
git bisect bad 9a8569d434107e721f5c7de0bf8ffe6471367d28
# bad: [0010d9c82a89e89fc1bc83e806f59f34f3deb893] Added ray shape and move_and_slide with snapping on 3D. Added stop_on_slope on 2d part
git bisect bad 0010d9c82a89e89fc1bc83e806f59f34f3deb893
# bad: [dfd1331690fab7e634e2e18fd7269bab8f759b3a] Allow editing of some unbound properties when hinted (or no range hinted)
git bisect bad dfd1331690fab7e634e2e18fd7269bab8f759b3a
# bad: [e5ae9750ed011c545cf2c002159f5095a9592e7c] Fixed leak in BulletPhysicsServer
git bisect bad e5ae9750ed011c545cf2c002159f5095a9592e7c
# good: [a5688ccd90573b1700e06417b94c0c46ce5a2e9a] Improve CollisionObject/CollisionObject2D warning message
git bisect good a5688ccd90573b1700e06417b94c0c46ce5a2e9a
# bad: [39fb83630dff7b6f6c3544dcc9ed70ed459aaf43] Added forgotten infinite_inertia to bindings
git bisect bad 39fb83630dff7b6f6c3544dcc9ed70ed459aaf43
# good: [b2aeb02e7d43d98973334e39db5c39626ba9f775] Merge pull request #16530 from AndreaCatania/rays
git bisect good b2aeb02e7d43d98973334e39db5c39626ba9f775
# bad: [497a4e9e25fb8cc9d3a95bc79b605aca79603648] Merge pull request #16757 from AndreaCatania/kinpush
git bisect bad 497a4e9e25fb8cc9d3a95bc79b605aca79603648
# bad: [6ed392f47a1970f7815f6f76b7bacfd0bb51b87c] Improved kinematic body 2D and 3D, Now can move rigid body
git bisect bad 6ed392f47a1970f7815f6f76b7bacfd0bb51b87c
# first bad commit: [6ed392f47a1970f7815f6f76b7bacfd0bb51b87c] Improved kinematic body 2D and 3D, Now can move rigid body

Seems like it is a feature introduced with #16757. Maybe it should be optional? CC @AndreaCatania

@nazgum
Copy link

nazgum commented Jan 12, 2019

Seems like it is a feature introduced with #16757. Maybe it should be optional? CC @AndreaCatania

In a top down 2d game where enemies are rigidbody2d's, you may not want the character to be able to push them around. Is there any way to stop kinematicbody2d from pushing rigidbody2d now?

@mrcdk
Copy link
Contributor

mrcdk commented Jan 12, 2019

You need to set the function parameter inifite_inertia to false

@nazgum
Copy link

nazgum commented Jan 12, 2019

You need to set the function parameter inifite_inertia to false

sweet thank you! =)

@akien-mga akien-mga changed the title KinematicBody2D. move_and_collide pushes Rigidbody around but gives no KinematicCollision2D back Document new "infinite_inertia" parameter in KinematicBody/KinematicBody2D APIs Feb 21, 2019
@akien-mga akien-mga modified the milestones: 3.1, 3.2 Feb 21, 2019
@akien-mga
Copy link
Member

Changed title accordingly.

@austinried
Copy link
Contributor

What if I wanted to have the player (KinematicBody2D) push the enemies (RigidBody2D) around, but I also want to have collision info returned by move_and_collide so I can act on it in some way? Is that not supported currently?

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

6 participants