@xyz said:
Once. If you have 3 script instances it should print 3 numbers in total. Are those 3 numbers same or different? If they are different the problem is somewhere else, not it random number generation.
@TwistedTwigleg @cybereality
I created a blank project. I created a node 2d. Created a Label and attached one script. Created one button.
extends Label
# Called when the node enters the scene tree for the first time.
func _ready():
randomize()
text=String(randi() %10)
func _on_Button_pressed():
randomize()
text=String(randi() %10)
I then Ctrl -D duplicated the label 3 times.
On first run:
1, 7,4, 3
1st pressed button:
4, 7,4,3
2nd pressed button:
2,7,4, 3
3rd pressed button:
9,7,4, 3
4th pressed button:
9,7,4, 3
5thd pressed button:
5,7,4, 3
On2nd run:
1,9,4,5
1st pressed button:
9,9,4,5
2nd pressed button:
2,9,4,5
3rd pressed button:
8,9,4,5
4th pressed button:
3,9,4,5
5thd pressed button:
8,9,4,5
other runs were the same way.
The original changes.
but the 3 duplicated nodes only change upon first run func ready():,
they do not change again.
Could you check and see if this does same thing for you or if this is a bug?
