![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | endernerd12 |
I’m really sorry if this is nooby, but I’m new to godot.
I’ve got a game, and these lines of code glitch out the game and prevent it from running:
for _i in range(4 + level):
var c = Coin.instance()
$CoinContainer.add_child(c)
c.screensize = screensize # this line raises errors
c.position = Vector2(rand_range(0, screensize.x), rand_range(0, screensize.y))
it just says
Invalid set index ‘screensize’ (on base: ‘null instance’) with value of type ‘Vector2’.
anyone know why this happens / how to fix it?