Plugin version: 0.8.32 (single-simd-parallel / Fast SIMD build)
Godot version: [4.6.3]
Description
I'm getting a recurring error in the console:
godot_rapier::spaces::rapier_space_callbacks::::collision_event_callback: Expected Area.
<C++ Source> src\spaces\rapier_space_callbacks.rs:175 @ godot_rapier::spaces::rapier_space_callbacks::::collision_event_callback()
This happens specifically when repeatedly entering and exiting an Area2D used for scene/level transitions, across multiple scene loads/unloads.
Setup
I have an Area2D (LevelTransition) used to trigger scene changes when the player enters it. The area's CollisionShape2D is enabled/disabled via set_deferred:
func _ready() -> void:
collision_shape.set_deferred("disabled", true)
body_entered.connect(_player_entered)
await LevelManager.level_loaded
collision_shape.set_deferred("disabled", false)
func _player_entered(_p: Node2D) -> void:
LevelManager.load_new_level(level, target_transition_area, get_offset())
The parent Level scene is freed via queue_free() after the transition:
func _free_level() -> void:
PlayerManager.unparent_player(self)
queue_free()
Steps to Reproduce
- Create a
Level scene with a LevelTransition (Area2D) that loads another Level scene on body_entered.
- Move the player in and out of the transition area, going back and forth between two levels, multiple times in a row.
- The error appears in the console after a few transitions.
Notes
- This does not break gameplay functionality — the level transition still works correctly.
- Originally I was toggling
monitoring/monitorable directly on the Area2D, which caused the same error more consistently. Switching to collision_shape.set_deferred("disabled", ...) reduced — but did not eliminate — the issue.
- The error seems related to a collision event callback firing for an
Area2D/CollisionShape2D that may have already been freed or is mid-transition between physics states during scene reload.
Happy to provide a minimal reproduction project if helpful.
Plugin version: 0.8.32 (single-simd-parallel / Fast SIMD build)
Godot version: [4.6.3]
Description
I'm getting a recurring error in the console:
godot_rapier::spaces::rapier_space_callbacks::::collision_event_callback: Expected Area.
<C++ Source> src\spaces\rapier_space_callbacks.rs:175 @ godot_rapier::spaces::rapier_space_callbacks::::collision_event_callback()
This happens specifically when repeatedly entering and exiting an
Area2Dused for scene/level transitions, across multiple scene loads/unloads.Setup
I have an
Area2D(LevelTransition) used to trigger scene changes when the player enters it. The area'sCollisionShape2Dis enabled/disabled viaset_deferred:The parent
Levelscene is freed viaqueue_free()after the transition:Steps to Reproduce
Levelscene with aLevelTransition(Area2D) that loads anotherLevelscene onbody_entered.Notes
monitoring/monitorabledirectly on theArea2D, which caused the same error more consistently. Switching tocollision_shape.set_deferred("disabled", ...)reduced — but did not eliminate — the issue.Area2D/CollisionShape2Dthat may have already been freed or is mid-transition between physics states during scene reload.Happy to provide a minimal reproduction project if helpful.