How can I make a button appear randomly on a scene?, I mean it to be there just sometimes.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Dream

please help me make a button appear randomly on a scene, maybe more scenes :slight_smile:

Do you want the button to appear randomly during the scene? Or do you want the button to appear in a random position in the scene?

Ertain | 2020-08-16 23:43

I want the button to appear sometimes on a scene, like if i go there, there is no button but if I go again maybe it will be there :slight_smile: (im not talking about the position)

Dream | 2020-08-17 05:58

:bust_in_silhouette: Reply From: Ertain

If you merely want a button to be randomly visible, use something like this condition:

  # Call randomize() if you haven't already.
  # If the random floating point number returned is greater than a certain number, show the button.
  if randf() > some_floating_point_number:

sorry but it didn’t work, please explain it again, I have a button, I want it to be visible just sometimes, I didn’t call randomize or anything, i have an empty script :))

Dream | 2020-08-26 14:12