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.
0 votes

I've been using Godot for a few days, and from what I've seen, it only accepts one script per node.

I am creating a state machine (FSM) for the player, each state is a different class with its own properties (exports).

The ideal would be to add a node for each state in order to see its [export] properties.

My question is, if I add a child node, will the engine do unnecessary positioning and rendering calculations? is there some kind of "fake" node?
what is the "best-practice" to do this in Godot?


in Engine by (53 points)
edited by

1 Answer

0 votes
Best answer

Technically yes, the engine will have to combine the position and orientation of the parent with the child (child nodes are positioned relative to parents). However, that's not really something to worry about, as far as performance is concerned.
As for rendering, the scene tree determines order of rendering in 2D, but that's pretty much it. Unless the parent node actually does some rendering of its own, there shouldn't be any extra rendering calculations.

by (168 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.