godotengine / godotengine/godot-docs

Make explicit that collisions are not reported to both move_and_collide() callers in some cases

Open
#7,799 0 comments 1 reaction 0 assignees View on GitHub
area:class reference enhancement topic:physics
Dominant language
reStructuredText
Stars
5.7k
Forks
3.8k
Avg merge
1d 20h
Merged PRs (30d)
25

Description

**Your Godot version:**

4.1

**Issue description:**

I have two CharacterBody2Ds calling move_and_collide() in every _physics_update(), yet when they collide sometimes only one notices the collision. I am told this is because RigidBody2D always notified both colliders, while CharacterBody2D only notifies you if you were moving in the direction of the offending object (as opposed to it colliding with you.)

I could not find this nuance when trying to understand why move_and_collide() would silently fail half the time in my tests (ships orbiting a body shooting bullets at each other).

Would be great if CharacterBody2D's move_and_collide() docs made this nuance clear.

**URL to the documentation page (if already existing):**

https://docs.godotengine.org/en/stable/classes/class_physicsbody2d.html#class-physicsbody2d-method-move-and-collide

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.