I am new so forgive me if this is a silly question.
I created a tool in a tscn file with an exposed property called SpriteIndex. I created a setter that updates the sprites frame property in the editor. It works, but whenever I save my project it gives me the error (times the number of tiles I have)
res://Tiles.gd:14 - Invalid set index 'frame' (on base: 'Nil') with value of type 'int'.
(Line 14 is sprite.frame = value)
The code I have is very simple:
export(int) var SpriteIndex setget setNdx
onready var sprite = $Sprite
sprite.frame = SpriteIndex
SpriteIndex = value
sprite.frame = value
Can anyone tell me what the error is and how to get rid of the error?
It works in the editor and when I launch the project.