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

A type error reported when GDScript preload an scene that used this GDScript #100285

Open
iiiron opened this issue Dec 11, 2024 · 3 comments
Open

Comments

@iiiron
Copy link

iiiron commented Dec 11, 2024

Tested versions

  • 4.3 stable

System information

MacOS 15, develop enviroment

Issue description

hex_grid.gd

class_name HexGrid
extends Node2D
# the hex_grid.tscn used this GDScript
const HEX_GRID = preload("res://scene/hex_grid.tscn")

test.gd

class_name Module
extends Node2D
# the $HexGrid is hex_grid.tscn
@onready var hex_grid: HexGrid = $HexGrid

the Editor report: Trying to assign value of type 'Node2D' to a variable of type 'hex_grid.gd'
Image

Steps to reproduce

as reported above

Minimal reproduction project (MRP)

NA

@HolonProduction
Copy link
Member

Please provide a minimal reproduction project which includes the scene (res://scene/hex_grid.tscn).

@iiiron
Copy link
Author

iiiron commented Dec 12, 2024

here its. This bug is more complicated than I thought. It may be related to the loading of the global singleton
typebugreport.zip

@iiiron
Copy link
Author

iiiron commented Dec 12, 2024

Please run game.tscn

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: For team assessment
Development

No branches or pull requests

2 participants