godotengine / godotengine/godot
More helpful error message for `Condition "!v.is_finite()" is true`
- Dominant language
- C++
- Stars
- 117k
- Forks
- 26.8k
- PR merge metrics
- PR metrics pending
Description
### Tested versions
- Reproducible in: v4.3.stable (77dcf97d8)
### System information
Godot v4.3.stable (77dcf97d8) - Windows 10.0.22631 - GLES3 (Compatibility) - Intel(R) Iris(R) Xe Graphics (Intel Corporation; 32.0.101.5972) - 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz (8 Threads)
### Issue description
Moving MeshInstance to an infinite or NaN coordinate causes this error
```
E 0:00:02:0077 instance_set_transform: Condition "!v.is_finite()" is true.
servers/rendering/renderer_scene_cull.cpp:935 @ instance_set_transform()
```
It's difficult to understand what does it mean. It would be better if error message read "Infinite coordinate provided to a mesh" or something like that so developers could more easily understand what happened and what do they need to look for in their code (i.e. divisions by zero)
### Steps to reproduce
1. Create a MeshInstance3D
2. Set mesh to Cube
3. Assign a new script to it
```gdscript
extends Node3D
func _ready() -> void:
self.position.x = NAN
```
### Minimal reproduction project (MRP)
N/A
Contributor guide
Research direction
Start at servers/rendering/renderer_scene_cull.cpp:935, where instance_set_transform() reports the non-finite vector condition. Reproduce the issue with a MeshInstance3D whose position.x is set to NAN, then improve the diagnostic so it identifies the invalid coordinate or transform cause. Done when the reproduction produces a more actionable error message.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100