I want to change the frame of instance such that any newly created ones have a difference frame. the issue is in the line $coffeeliquid.frame = Global.Currentdrink.
I keep getting this error:
Invalid set index ‘frame’ (on base: ‘null instance’) with value of type ‘int’.
I’ve been stuck on this problem for a while now. what can I do?
$Drinkjug points to a Node that does not exist, thus becoming null at runtime, giving you that error.
Either add the Node named Drinkjug or remove that line.
The $ syntax is just shorthand for get_node() and thus expects the Node to have the name after the $ symbol. If that node doesn’t exist in the current node tree the script is attached to, it becomes null.
I want switch the animation frame of instances of Coffeeliquid based on the current value of a global variable. The drinkjug part isn’t very important, but even when I delete it, it still gives me the (Invalid set index ‘frame’ (on base: ‘null instance’) with value of type ‘int’.) error. I cant seem to animate an instance at all