Getting all current physics contacts

esakesak Posts: 3Member
in 3D

Greetings all!

I have just started fiddling around with Godot 3D and physics, from C# (in VS Code).
I'm having problems finding how I can get hold of all current body contacts in the physics world.
I want to get additional info from them, for example contact point and normal.
Is this possible? From C# or GDScript?
Is there any tutorial or sample covering this?

Best Answer

  • esakesak Posts: 3
    Accepted Answer

    I solved it by reading the body state from PhysicsServer :)

Answers

  • TwistedTwiglegTwistedTwigleg Posts: 2,873Admin

    Welcome to the forums @esak!

    What node are you using for collision section? If you are using a KinematicBody, you can use the get_slide_collision function to get collision data from the move_and_slide function. For RigidBody nodes, I believe you can use signals, though I’m not sure if additional collision data (normals, etc) is passed.

  • esakesak Posts: 3Member

    Thanks @TwistedTwigleg !

    I'm using RigidBody and have tried with the signal "body_entered", but I only get the other body in it.

  • esakesak Posts: 3Member
    Accepted Answer

    I solved it by reading the body state from PhysicsServer :)

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file