This site is currently in read-only mode during migration to a new platform.
You cannot post questions, answers or comments, as they would be lost during the migration otherwise.
+1 vote

I have a game character with lots of statistics, and I've put each stat in its own node. So I was wondering does the engine loop through each node in the character's tree each update, to see if it should process each node? Or is it smart enough to ignore nodes that shouldn't be processed?

in Engine by (251 points)

I wonder WHY you put stats as nodes... But about your question. What is type of this nodes? Node, Node2D? I THINK engine may somewhere iterate by this nodes, so for me - that isn't good idea.

This uses the basic Node class. Each stat consists of two variables with some functions to manipulate them. It was something I did when I first started learning the engine, and have regretted it ever since.

1 Answer

+2 votes
Best answer

Bad approach, don't use a lot of nodes to only store data. Every node have their own overhead, with or without process activated. Best aproach is to store al data in one or few scripts.

by (343 points)
selected by
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.