This is the testing Godot forums! All forum posts unique to this forum will be deleted! Please use the main forums here for any posts you want to keep. All forum rules still apply.

Just to be sure... 2D Collisions

1000h1000h Posts: 133Member

.move() Method is the only method that when called through input will cause a kinetic(or rigid) body 2d physics to collide with other collision shapes, correct?

Best Answer

  • RossRoss Posts: 199
    Accepted Answer

    Your question is a little weird, Physics bodies collide on their own. Move() attempts to move (translate) the body but stops if it detects a collision. It's the only method to do that, as far as I know. And only kinematic bodies have that method.

    Have you seen the physics introduction?

    If you actually want to simulate semi-realistic physics, you'll want to use rigidbodies and use forces instead of just moving things. No, forces() is not a method, see the docs: http://docs.godotengine.org/en/latest/classes/class_rigidbody2d.html Rigidbodies have a few different methods for pushing them around: apply_impulse(), add_force(), set_applied_force(), etc. You can also just set their position or their velocity, though if you try to do that every frame things can start getting messed up.

Answers

  • SakakiSakaki Posts: 30Member

    Actually rigidbody moves through forces.

  • 1000h1000h Posts: 133Member

    is forces() a method

  • RossRoss Posts: 199Member
    Accepted Answer

    Your question is a little weird, Physics bodies collide on their own. Move() attempts to move (translate) the body but stops if it detects a collision. It's the only method to do that, as far as I know. And only kinematic bodies have that method.

    Have you seen the physics introduction?

    If you actually want to simulate semi-realistic physics, you'll want to use rigidbodies and use forces instead of just moving things. No, forces() is not a method, see the docs: http://docs.godotengine.org/en/latest/classes/class_rigidbody2d.html Rigidbodies have a few different methods for pushing them around: apply_impulse(), add_force(), set_applied_force(), etc. You can also just set their position or their velocity, though if you try to do that every frame things can start getting messed up.

  • 1000h1000h Posts: 133Member

    " It's the only method to do that, as far as I know. And only kinematic bodies have that method. "

    This is what I wanted

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.