how to get collision(as bool) of rigid body to static body ?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By bgegg

I think that kinematicbody had a function to detect collisions.
is_on_floor () function.
However, it does not seem to be found in the rigidbody.
And so is staticbody.
It does not seem to be a signal of staticbody.

how to get hit of rigidbody?

i add node like this.

node
    rigidbody(ball of falling)
    staticbody(as floor)
:bust_in_silhouette: Reply From: kidscancode

To report collisions with rigid bodies, you must enable “Contact Monitoring” and use the body_entered() signal:

https://docs.godotengine.org/en/latest/classes/class_rigidbody.html#signals

thanks for comment.
thanks to i did it with signal and Contact monitor and contacts reported .

but why does this use a signal?
what is difference between signal and function?

bgegg | 2019-06-19 03:07

Because a collision can occur at any time, and that’s when the signal is emitted to notify you. It is more efficient than polling every frame to check for collisions.

kidscancode | 2019-06-19 03:23

thanks for comment.
I see!
I was able to understand somehow.
It is likely to freeze if checked in all frames.

bgegg | 2019-06-19 08:34