Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Sprites throw error unless preloaded on draw event — issue in new projects but not old ones

A topic by NekoLab created 67 days ago Views: 138 Replies: 2
Viewing posts 1 to 2
(2 edits)

Apologies if this question has already been asked — I’d be grateful for a link in that case~

Here’s the situation: I’ve been using GMLive for quite a while now (around 3 years), and previously, if a sprite was present in the resource tree, I could simply call something like draw_sprite(spr_new, ...) in the draw event, and it would render without any issues.

However, now — unless a given sprite has already been explicitly referenced somewhere in the code beforehand, trying to use it will always throw a error: 

[GMLive][30.04.2025 18:22:05][ERROR] Runtime error: [error] `instance#ref instance 100001(obj_controller)` (instance of obj_controller) does not have a variable `sp_new`.

 called from obj_controller:Draw_0 [line 235, col 13]

Interestingly, when I open an older project (about 6 months old), this issue doesn’t occur. But in newer projects — it’s a constant problem...

GMS IDE version: v2024.13.0.190

Developer

You will want to update GMLive or disable “Automatically remove unused assets” checkbox in Game Options - see changelog

Thank you so much! It seems like it worked — sorry for the oversight~