Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Numbers are treated as different types when run from editor than from release builds #56609

Closed
shelbyd opened this issue Jan 8, 2022 · 5 comments

Comments

@shelbyd
Copy link

shelbyd commented Jan 8, 2022

Godot version

3.2.3.stable

System information

Windows 10

Issue description

Exporting a project removes type information, causing floats to be treated as ints.

It is a severe concern that something can work in the editor version and not in an exported version. This would require me to re-check every change I make with the exported version.

Steps to reproduce

Given the following GDScript:

export(float) var something = 3
var other

func _ready():
  other = something / 8

When run from the editor, other will be 0.375. When run from an exported project, other will be 0.

Minimal reproduction project

No response

@Calinou
Copy link
Member

Calinou commented Jan 8, 2022

3.2.3.stable

Godot 3.2.x is not supported anymore, so please upgrade to 3.4.2 and check if the issue still occurs there.

@KoBeWi
Copy link
Member

KoBeWi commented Jan 8, 2022

Sounds similar to #42124
What if you declare the variable as export var something: float = 3 instead?

@shelbyd
Copy link
Author

shelbyd commented Jan 23, 2022

This behavior is the same in 3.4.2-stable.

If I add the type as an annotation as export var something: float = 3, then other is 0.375 in both the editor and exported project, as expected.

@akien-mga
Copy link
Member

Confirmed in 3.5 beta 1, and I've checked and it wasn't fixed by #57851.

@akien-mga akien-mga changed the title Numbers are treated as different types when run from editor than from exported project Numbers are treated as different types when run from editor than from release builds Feb 10, 2022
@akien-mga
Copy link
Member

Duplicate of #39215.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants