From dda6066c33512f2c3bfd24fd91b452411eb85a02 Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Thu, 5 May 2022 09:45:58 +0800 Subject: [PATCH] Improve documentation of `rand_range` (cherry picked from commit 84cc0c9c47603eb9f4c45d1f37bc9b1782cd0a33) --- modules/gdscript/doc_classes/@GDScript.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/gdscript/doc_classes/@GDScript.xml b/modules/gdscript/doc_classes/@GDScript.xml index 28b3772ba4d..7b2a3ffb7a7 100644 --- a/modules/gdscript/doc_classes/@GDScript.xml +++ b/modules/gdscript/doc_classes/@GDScript.xml @@ -790,10 +790,11 @@ - Random range, any floating point value between [code]from[/code] and [code]to[/code]. + Returns a random floating point value between [code]from[/code] and [code]to[/code] (both endpoints inclusive). [codeblock] prints(rand_range(0, 1), rand_range(0, 1)) # Prints e.g. 0.135591 0.405263 [/codeblock] + [b]Note:[/b] This is equivalent to [code]randf() * (to - from) + from[/code].