+1 vote

I have a RigidBody in 3D that has two collision shapes. Once the body reports contacts, say against a StaticBody like a platform, how would I detect which shapes are making contact?

I'm doing this within integrateforces()

So I can get the objects, but I can seem to find what is available from there to resolve which shape is making contact.

func _integrate_forces(state):

    var contacts = state.get_contact_count()

    if(contacts > 0):
        for i in range(contacts):

I'm overlooking something... Can anyone kindly point me to a method for this kind of query?

in Engine by (5,264 points)

1 Answer

+4 votes
Best answer

So for any future visitors, it's:


Giving it the contact index, returns the shape's index inside the parent RigidBody.

by (5,264 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.