From 898327b31273bf9991c3c30b1e9ac0d1f35d8a41 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Fri, 18 Dec 2020 00:37:36 +0100 Subject: [PATCH] Document known bug with `Object.new()` and workaround --- doc/classes/Object.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/classes/Object.xml b/doc/classes/Object.xml index 01f63ab641e..05e31de97f8 100644 --- a/doc/classes/Object.xml +++ b/doc/classes/Object.xml @@ -18,6 +18,7 @@ The [code]in[/code] operator will evaluate to [code]true[/code] as long as the key exists, even if the value is [code]null[/code]. Objects also receive notifications. Notifications are a simple way to notify the object about different events, so they can all be handled together. See [method _notification]. [b]Note:[/b] Unlike references to a [Reference], references to an Object stored in a variable can become invalid without warning. Therefore, it's recommended to use [Reference] for data classes instead of [Object]. + [b]Note:[/b] Due to a bug, you can't create a "plain" Object using [code]Object.new()[/code]. Instead, use [code]ClassDB.instance("Object")[/code]. This bug only applies to Object itself, not any of its descendents like [Reference]. https://docs.godotengine.org/en/3.2/getting_started/workflow/best_practices/node_alternatives.html