0
\$\begingroup\$

So basically I am spawning the object lets say the enemy at random position on screen. Should I handle the spawning in a different gameobject or in enemy. So when enemy is destroyed it calls the function at to respawn it at different location.

\$\endgroup\$
3
  • \$\begingroup\$ "Better" according to what metric or criteria? When you put the spawning on the enemy object, do you get the desired outcomes? If not, in what way does the result differ from what you want? \$\endgroup\$ Commented Jul 12, 2022 at 11:50
  • \$\begingroup\$ I get the desired outcomes in both cases. I wanna know which is better for clean code and optimization and stuff like code. \$\endgroup\$ Commented Jul 12, 2022 at 11:56
  • \$\begingroup\$ To answer what's better for performance, open up the profiler and measure each option. To answer what's better for code cleanliness, ask the stakeholders who need to work with the code (ie. you and your team) which style they personally find cleaner and more convenient to work with. \$\endgroup\$ Commented Jul 12, 2022 at 12:06

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.