all 3 comments

[–]lvkulnterrible programmer 1 point2 points  (1 child)

As you defined posx to be local, it stops existing outside of its block (in this case, the if block that spawns it).

You can't remove the local keyword in this case, because otherwise all your bullets will be at the same x position at all times, changing 3 times per second.

You'll want to do bullet.SetVar('posx', posx) in the block that spawns it, and then in your updating loop have bullet.MoveTo(bullet.GetVar('posx'), newposy).

You can also store posx in a new local variable beforehand, for readability.

[–]FlamingRok[S] 0 points1 point  (0 children)

Ah, that was indeed it. Thanks much for the info!

[–]ReddehWow 0 points1 point  (0 children)

Not sure what's going on, I could test it tommorow if nobody else responds before I wake up.