0 votes

I am trying to make a popup bar and i want it to show in a random position
inside the screen.

Godot version 3.4.4
in Engine by (22 points)

1 Answer

+2 votes

no i found the solution. for me its
(pblock means popup)

var Pblock = preload("res://Popup4.tscn")

(i added a timer so when its timeout, it will play this method)
Random:

var Pblock_instance = Pblock.instance()
Pblock_instance.set_position(Vector2(rand_range(-200,200), rand_range(-100, 200)))
add_child(Pblock_instance)
by (22 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.