-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
Improved kinematic body, Now can move rigid body #16757
Conversation
d6a2fd5
to
ab3d2db
Compare
ab3d2db
to
6ed392f
Compare
Now it's possible to push even with 2D kin body |
Thanks, great feature :) |
Amazing! |
@@ -362,12 +363,12 @@ struct _RigidBody2DInOut { | |||
int local_shape; | |||
}; | |||
|
|||
bool RigidBody2D::_test_motion(const Vector2 &p_motion, float p_margin, const Ref<Physics2DTestMotionResult> &p_result) { | |||
bool RigidBody2D::_test_motion(const Vector2 &p_motion, bool p_infinite_inertia, float p_margin, const Ref<Physics2DTestMotionResult> &p_result) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You forgot to update the RigidBody.test_motion()
bindings here https://github.com/godotengine/godot/blob/master/scene/2d/physics_body_2d.cpp#L890 to add the infinite_inertia parameter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh thanks you... I forgot it because yesterday I got some issue with bindings so I removed it from all bindings to test it and apparently I forgot to re-add it.
Thanks you
Related to this comment: godotengine#16757 (comment)
I'm having problems waking up rigid bodies with Kinematic bodies, I don't know if it is the same issue, I'm adding a little project to show the problem. |
@David-Ochoa you have to use only one
|
@AndreaCatania : I made the changes but still it is not working, one ball hits the "player" before hiting ground, that one can wake up other rigid bodies but player can't, here is a video: |
@David-Ochoa Fixed: #18138, Can you please confirm it? |
@AndreaCatania Yes, it is working now, thanks and great job. |
Just a heads-up. The engine parses the old For example: move_and_slide(vel, Vector3(0,1,0), 0.05, 4, MAX_SLOPE) # 3.0.2
# is parsed as...
move_and_slide(vel, Vector3(0,1,0), true, 4, MAX_SLOPE, deg2rad(45)) # Master
# which should be...
move_and_slide(vel, Vector3(0,1,0), true, 0.05, 4, MAX_SLOPE) Should be added to the list of known incompatibilities for the next version. |
Ok so how can we make KinematicBody2D not push RigidBody2D's around, if we don't want that behavior? So it works like in 3.0? I have a top down game where enemies/crates are RigidBody2D, and after upgrading to beta 3.1, the player can push enemies/crates around now. Changing Mass, Friction and Linear Damp seem to not help in stopping this new behavior. Update: for anyone else who runs into this, I found out it can be controlled with the infinite_inertia option which is set in move_and_slide; true means you push rigidbodies, and false means you don't =) |
If you use move_and_collide instead of move_and_slide you wont push bodies |
Does this also mean that rigid bodies will not move a stationary kinematic body if infinite inertia is on? Also how would you control the force with which kinematic bodies move rigids around, in 3.0 properties like mass and weight are not taken into account |
Now kinematic body can interact with rigid body.
Fixes #16329
Fixes #13148