Skip to content

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

@Unequipped

Description

@Unequipped

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions