Closed HeavensSword closed 2 months ago
If you have updated the addon from version 0.6.x ⇾ 0.7 within a project, then it's entirely possible that there's some lingering code in one of the hidden Godot directories that hasn't properly updated the name change of phantom_camera_2D
to phantom_camera_2d
— lowercased “d” at the end. Creating a new project and transferring over the res://
content might solve it then.
If the above doesn't help, would you be able to share a Minimal Reproduction Project (MRP) where that issue happens? Mainly so I can see what setup and logic could potentially trigger this. Haven't come across it myself, and there's not much I can do until I can replicate and verify that a fix would work.
Hello,
This is an issue for me as well-- but, in my case at least, I've narrowed the issue down to the use of GDScript's class_name
within a Mono build of Godot.
I've seen Nathan Hoad's users (the Godot Dialgue Manger addon) mention this issue as well, though, as far as I know, no one has more information as to a solution or cause, or has created a reproducible project.
A workaround to avoid getting an error is to click build, then play.
I no longer encounter the error I described after having upgraded into 4.3rc1 (I think around beta1 is when my issue was resolved, I don't know which PR was relevant).
It was resolved in, if my reading is correct, Godot 4.3 Beta 3 in this PR. Has been a long-standing issue with removing or changing classes in GDScript.
Closing the issue as Godot 4.3 should be addressing, or at least mitigating, this issue. If it's still being encountered after updating to that Godot version, or later, please do reopen it.
Issue description
I'm getting the error "Parse Error: Identifier "PhantomCamera2D" not declared in the current scope." intermittently when hitting play from the Godot editor. This has been happening more frequently it seems like, especially after updating to the latest version. Sometimes it runs, other times it fails.
When the error occurs, it points to this line (348):
Steps to reproduce
I'm really unsure as it seems to happen randomly upon hitting play. I'm not even using PhantomCamera2D in my game.
(Optional) Minimal reproduction project
No response