godotengine / godotengine/godot

change process_mode will lead to abnormal collision behavior

Open
#110,679 0 comments 1 reaction 0 assignees View on GitHub
bug topic:physics
Dominant language
C++
Stars
117k
Forks
26.8k
PR merge metrics
PR metrics pending

Description

### Tested versions

4.5-stable_win64

### System information

Windows11

### Issue description

If the "process_mode" is changed during a collision, it will cause the collision to keep triggering. If the procee_mode is not changed, it will only trigger once.

### Steps to reproduce

extends Area2D

func _on_hurt_box_body_entered(body: Node2D) -> void:
print('entered')
set_deferred("process_mode",Node.PROCESS_MODE_DISABLED)
set_deferred("process_mode",Node.PROCESS_MODE_INHERIT)

### Minimal reproduction project (MRP)

[process_mode_area2d_bug.zip](https://github.com/user-attachments/files/22418469/process_mode_area2d_bug.zip)

Contributor guide

Open the contributing guide

Research direction

Start by running the attached process_mode_area2d_bug.zip project on Windows 11 with Godot 4.5-stable and reproduce the Area2D collision using the shown _on_hurt_box_body_entered handler. Trace the collision and process_mode behavior around the deferred changes; done means the collision does not keep triggering unexpectedly after the process mode is changed.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
game-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.