0 votes

I have a creature that lays eggs, and the eggs hatch into more monsters.
However, the egg has to preload the creature it creates and the same for the monster with the egg and then the preloaded egg loads the animal again. bingo bongo infinite preloading and it gives an error. How can I avoid this?

in Engine by (36 points)

1 Answer

+2 votes

You can either
- use load instead of preload
- build a container around Monster and egg which preloads both
- combine both in a single scene/object/script

this are the first 3 ideas that came to my mind .... there are dozents of other ways to deal with this

by (3,940 points)

Did not know you could just load the monster. It works great now!

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 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 webmaster@godotengine.org with your username.