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

Collision signals don't work on static and rigid RigidBody2D but do work between rigid and kinematic RigidBody2D #23042

Open
Tracked by #45334
fozbstudios opened this issue Oct 16, 2018 · 14 comments

Comments

@fozbstudios
Copy link

I tried. Sorry if dupe

Godot version:

v3.0.6.stable.official.8314054

OS/device including version:

arch linux (godot package v:aur/godot-bin 3.0.6-1)

Issue description:

collision reporting doesn't work when a RigidBBody2d mode is static but does when its set to kinematic.
Steps to reproduce:
create two rigid bodies and set one to static collision reporting wont work when properly set up

Minimal reproduction project:

godotBug.zip
The 2 folders in the zip are snapshots of my git repo. Full history is retained in both dirs. project is located at godotQWOPProj/project.godot in both dirs and the script where i set up the signals is located at godotQWOPProj/groundLineStaticBody2D.gd though its attached to a RigidBody2d.

@eon-s
Copy link
Contributor

eon-s commented Oct 16, 2018

I think it should not report anything on static or kinematic mode, since those kind of bodies do not detect anything and the physics engine do not expect anything from bodies like that either.

Looks more like a bug on the kinematic mode (unless it is a feature).

@Chaosus
Copy link
Member

Chaosus commented Oct 16, 2018

cc @AndreaCatania

@AndreaCatania
Copy link
Contributor

The kinematic body can be moved and it's fine if it keep track of collision. @eon-s Do you think that it should not keep track of collisions?

Also for static body it's expected

@Chaosus Chaosus changed the title collision signals don't work on static and Rigid rigidBody2d but do work between rigid and kinetic rigidBody2d Collision signals don't work on static and rigid RigidBody2D but do work between rigid and kinematic RigidBody2D Oct 16, 2018
@eon-s
Copy link
Contributor

eon-s commented Oct 16, 2018

@AndreaCatania I think it is not normal for a kinematic to keep track of collisions (all the implementations I have seen lack of collision awareness except while using special methods like move_*), but if this is intended for rigids in kinematic mode, then it could be really useful and should be documented.

@ninao-xyz
Copy link

I'm currently using a few RigidBody2D nodes in kinematic mode on a game I'm working, and the collision detection has been proven quite handy for my use case. If there's no downsides of keeping track of collisions for rigidbodys in kinematic mode, please consider keeping them.

@fozbstudios
Copy link
Author

fozbstudios commented Oct 17, 2018

Personally I think that collisions should be possible to be reported ( if monitor is on of course ) for all modes, but please at least keep it for kinematic. How do you all implement reporting collisions with an object that is not supposed to be moved (ex the ground)? At minimum the docs should be updated to reflect the limitations of each type

@AndreaCatania
Copy link
Contributor

AndreaCatania commented Oct 17, 2018

Well it's not a limitation, you should track collision of RigidBody and from there perform your calls. I'm not quite sure but the @eon-s reasoning seems correct to me. I want to think about it.

@fozbstudios
Copy link
Author

@Andrea ok but depending on the ratio of Rigid to kinematic this approach may not make sense. What do we gain by removing this from the kinematic capabilities

@AndreaCatania
Copy link
Contributor

To move the kinematic body you use a query to check if the motion can be performed that also return the list of collided.

So keep track even of physics engine generated collisions could be useless

@AndreaCatania AndreaCatania added this to the 3.1 milestone Oct 19, 2018
@ninao-xyz
Copy link

To move the kinematic body you use a query to check if the motion can be performed that also return the list of collided.

what if the body (when in kinematic mode) is being moved by an animation player?

@eon-s
Copy link
Contributor

eon-s commented Oct 19, 2018

In that case, it is not expecting collisions and may need a trigger to solve overlaps and interruptions on the animation.

@fozbstudios
Copy link
Author

is it really that much overhead

@AndreaCatania
Copy link
Contributor

It's not the correct way to move a kinematic

@akien-mga akien-mga modified the milestones: 3.1, 3.2 Jan 24, 2019
@akien-mga akien-mga removed this from the 3.2 milestone Jan 9, 2020
@KoBeWi
Copy link
Member

KoBeWi commented Dec 10, 2020

Seems still valid in 3.2.4 beta3

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

7 participants