godotengine / godotengine/godot

Numerical type does not update until inspector value is changed

Open
#97,909 2 comments 0 reactions 0 assignees View on GitHub
bug confirmed topic:editor
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:

![image](https://github.com/user-attachments/assets/534bdfd6-91b7-474e-9a93-203fed6b067d)

and got these values printed out:

![image](https://github.com/user-attachments/assets/dffddbed-2af5-41a2-9e74-d22e744e23fc)

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.

![image](https://github.com/user-attachments/assets/c594fce4-060c-44e5-ac51-98803df4c6e2)
![image](https://github.com/user-attachments/assets/3ea60ba7-e392-499b-bc4d-0a71d18c7557)

### Steps to reproduce

1. Have a variable (EX: var radius = 100)
2. Run the script by pressing the button boolean [it should work]
![image](https://github.com/user-attachments/assets/63f39216-f356-4beb-a36f-584004cf72d0)
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.