Storing node/object references in an array
Asked Answered
D

3

0

Godot.Collections.Array<ref Node> objectNodeReferences;

This is not valid syntax for C# to store references of a given node in an array for example. Is there any valid syntax for achieving this?

Divers answered 26/10, 2023 at 14:43 Comment(0)
E
0

Divers Drop the ref

Godot.Collections.Array<Node> objectNodeReferences;
Embarrassment answered 26/10, 2023 at 14:57 Comment(0)
D
0

It's not going to attempt to store a copy of the entire object? I can never remember these things, but I guess ref and out are more suitable for specific and smaller pieces of data which you would like to tune directly, like a Vector type variable for example.

Divers answered 27/10, 2023 at 16:37 Comment(0)
E
0

Divers It will store references to type specified by generic parameter.

Embarrassment answered 27/10, 2023 at 20:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.