0 votes

If you have something in a scene that has two completely different appearances, but the same underlying data (ex: hitpoints), what do you do?

  1. Have one node that can switch its draw commands, textures, meshes, materials. etc. to look different on command.
  2. Have two nodes, one for each appearance, and make one visible and hide the other as necessary.
  3. Have two nodes, one for each appearance, and load one node tree and remove/free the other as necessary.
  4. Something else...
in Engine by (70 points)

1 Answer

+1 vote
Best answer

If I were you, I would choose option #2 for it being the easiest. Option #1 is tedious and you should use it only if your objects are extremely modular in nature. For example, imagine making a Dress-Up game or even a simple character customization system. You wouldn't want to create thousands of nodes for every possible combination. Instead, you would want to create a base node and have the code alter the different aspects of your objects via draw calls, mesh swapping, texture modifications etc.

For a small project, you could just hide and show the premade nodes. If your character has two skins, make two nodes for them. You can also disguise the fact that you alternate between two or more versions by adding animations and particle effects.

by (1,890 points)
selected by

Thanks. My concern with #2 is visibility flag only controls visibility. When nodes remain in tree, they can still interact with other logic, like overlapping checks.

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.