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

[Unimplemented Item in Editor: Terrain] Editor pinning terrain item in hotbar error: Cannot call method 'instantiate' on a null value #20

Open
Unequipped opened this issue Jun 22, 2024 · 2 comments

Comments

@Unequipped
Copy link
Contributor

Description:
Pinning the terrain item in the editor hotbar sometimes results in an error. The other items don't seem to have any issues.

To recreate:
Run the editor and open the item selection menu. Either drag and drop or click the terrain option to place it in the hotbar. Click and hold in the hotbar slot with the terrain item until it is pinned. Releasing the click results in an error but moving the mouse out of the terrain hotbar slot and then releasing doesn't result in an error. You don't have to pin the item for the error to show - tapping it with or without it being pinned also results in the same error.

The Error:
Cannot call method 'instantiate' on a null value
The code it points to:
res://level_designer/items/preview_items/preview_display/complex_preview_display.gd

@tool
class_name ComplexPreviewDisplayData
extends PreviewDisplayData

@export var preview_scene: PackedScene


func create():
	return preview_scene.instantiate() # <-- HERE

Cause of error:
Not too sure but something to do with the act of releasing mouse click while the cursor is within the hotbar slot holding the terrain.

@GTcreyon
Copy link
Contributor

I think that's just because the preview scene isn't implemented yet, so it's trying to instance a null scene.

@Unequipped
Copy link
Contributor Author

Right makes sense, did a bit of digging and was starting to think that. I'll retitle the issue.

@Unequipped Unequipped changed the title Editor pinning terrain item in hotbar error: Cannot call method 'instantiate' on a null value [Unimplemented Item in Editor: Terrain] Editor pinning terrain item in hotbar error: Cannot call method 'instantiate' on a null value Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants