godotengine / godotengine/godot
Numerical type does not update until inspector value is changed
- Dominant language
- C++
- Stars
- 117k
- Forks
- 26.8k
- PR merge metrics
- PR metrics pending
Description
### Tested versions
Godot 4.3 15 Aug 2024
### System information
Godot v4.3.stable - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3060 (NVIDIA; 32.0.15.6590) - Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz (8 Threads)
### Issue description
The math doesn't work and doesn't multiply correctly. I'm not sure if it has to do with types not working or if its reading a different value. I tested it using these print statements:

and got these values printed out:

All variables in these segments are declared explicitly as floats.
However, the issue solved itself after I changed the values in the inspector, then reverted the values.


### Steps to reproduce
1. Have a variable (EX: var radius = 100)
2. Run the script by pressing the button boolean [it should work]

3. Now, change the variable to an explicit float (var radius : float = 100)
4. Click the button again
It doesn't always happen, and I'm not sure why
### Minimal reproduction project (MRP)
[bugreport.zip](https://github.com/user-attachments/files/17273494/bugreport.zip)
Contributor guide
Research direction
Start by opening the attached bugreport.zip and reproducing the steps with the button boolean and the radius variable. Compare the behavior with an inferred numeric value and an explicit float, including after changing and reverting the inspector value; done means the cause of the intermittent incorrect multiplication is identified and the behavior is corrected.
Written by the indexing model from the issue text.
Assessment
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100