public lateinit Vector2 is unassigned if has a value of 0,0 in Godot editor
See original GitHub issueVersion: Godot 3.2
*OS/device including version: Windows 10
Issue description: If your Kotlin class has a public lateinit var of Vector2, it’s “unassigned” value in the Godot editor is 0,0. Giving it any other value will cause it to be assigned in Kotlin, and everything is fine. However, the user may want 0,0 as their value, and in this case, accessing the var in Kotlin will result in an unassigned lateinit var exception being thrown.
Steps to reproduce:
Run the coroutines sample project.
MirrorBall.kt
lateinit var center: Vector2
Minimal reproduction project: The coroutines sample project.
Issue Analytics
- State:
- Created 4 years ago
- Comments:16 (16 by maintainers)
Top Results From Across the Web
Vector2(0, 0) is not equal to Vector2(0, 0) for some ...
You can be lucky when the values have been initialized from the same source/assignment and not changed since then. But it is still...
Read more >Vector2 — Godot Engine (stable) documentation in English
Vector used for 2D math. 2-element structure that can be used to represent positions in 2D space or any other pair of numeric...
Read more >Getting and setting individual x and y values in Vector2
I have the following code: var Location = Vector2(64, 64) if Location[0] > 911.0: Location[0] = ... I check what the x value...
Read more >What does, "Invalid call. Nonexistent 'Vector2' constructor." ...
Nonexistent constructor means that you haven't passed the correct arguments to the constructor, "Vector2()". "Vector2()" can take different ...
Read more >Why we often use Vector2.ZERO for moving an object
Hi, Vector2.ZERO is just a vector with zero length its the same as Vector2(0,0) It has no special importance for anything.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If you are really curious https://github.com/utopia-rise/godot-kotlin/blob/feature/rework_entry_code_generation/REGISTRATION.md but note: i’m not yet finished. Expect some minor changes and wait for the full PR.
Ha whops