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

Vehicle Instance is broken (nan error) #35877

Closed
Tracked by #45333
tobiblender opened this issue Feb 3, 2020 · 7 comments · Fixed by #45803
Closed
Tracked by #45333

Vehicle Instance is broken (nan error) #35877

tobiblender opened this issue Feb 3, 2020 · 7 comments · Fixed by #45803

Comments

@tobiblender
Copy link

tobiblender commented Feb 3, 2020

Godot version:
3.2 stable
OS/device including version:
Win8
Issue description:
i instance a vehicle (tscn) several times per gdscipt (preload) in a for-loop.
the first instance is allways somehow broken - it gets transform-vectors with "-1.#QO" throws an error.
i found out about the cause via the debugger > breakpoints feature

the console puts Error NAN
E 0:00:00.712 instance_set_transform: Condition "Math::is_nan(v.x)" is true.
<C++-Quellcode>servers/visual/visual_server_scene.cpp:601 @ instance_set_transform()

Steps to reproduce:

  • open the project
  • open the scene vehicle_instance_bug.tscn
  • press F5
  • the output throws the NAN Error

as i said - i investigated via debugger and found out that the error is allways from the first instance
the following instances are fine.

Minimal reproduction project:
Vehicle_instance_bug_1.zip

@tobiblender
Copy link
Author

PS: this does not happen in 3.1.2 (with same project)

@groud
Copy link
Member

groud commented Feb 3, 2020

Please provide a minimal reproduction project.

@tobiblender tobiblender changed the title 3.2 Bug - first Vehicle Instance is allways broken/frozen 3.2 Bug - Vehicle Instance is broken (nan error) Feb 3, 2020
@tobiblender
Copy link
Author

Hi again :)
okay i made a mini-project to show it off.

@Calinou Calinou changed the title 3.2 Bug - Vehicle Instance is broken (nan error) Vehicle Instance is broken (nan error) Feb 8, 2020
@matkoniecz
Copy link

matkoniecz commented Feb 25, 2020

It appeared to me after clean Godot install, downloading Truck Town project and selecting Tow Truck as an option. (also happens with the middle option)

@Demindiro
Copy link
Contributor

I suspect it is a thread synchronization issue, since changing seemingly unrelated things "fixes" it (e.g. if the VehicleBody node is not in a separate scene the bug won't occur, if it is it does) and it doesn't happen consistently. In either case, I tried to narrow it down as much as possible.

vehicle_is_nan.zip

When spamming the "Spawn" button, the issue does occur eventually.

@qarmin
Copy link
Contributor

qarmin commented Jan 30, 2021

I found that m_suspensionLength variable was uninitialised and sometime had Nan value.
From my tests initializing it with zero fixes problem.

@akien-mga akien-mga added this to the 4.0 milestone Feb 3, 2021
@pouleyKetchoupp
Copy link
Contributor

Junior job hint:
Based on #44125 (comment), this issue can be fixed separately from #44630/#44125 by just setting the default value to m_suspensionLength.

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

Successfully merging a pull request may close this issue.

8 participants