Hi all,
First of all, this is my code:
#the ball scene we will instance
var scene = load("res://ball.tscn")
for ball in get_tree().get_nodes_in_group("balls"):
#get the position of each of the balls
var ballPos = Vector2(ball.get_pos().x+30, ball.get_pos().y+30)
var newBall = scene.instance()
newBall.set_pos(ballPos)
get_node("/root/gameLevel").add_child(newBall)
print("adding balls")
newBall.add_to_group("balls")
#random direction
newBall.set_state(STATE_MOVING)
print("ball added: ", str(newBall), " at ", str(ballPos))
So essentially I have a powerup, I touch it, this code is triggered, ball is meant to appear (Currently at 30 pixels to the right and below the current ball just to test).
Now I can see in the print statement that a newball is created, it has a unique name, it has a postition. The ball is never visible though. I just can't figure it out.
Can anyone see anything glaringly obvious? I feel like I'm at my ends. a few days of looking at it here and there and it's time to ask.
Any help MUCH appreciated...
EDIT: turns out it's the STATE line. I'll investigate further and report back for anyone in the future.