Answer the question
In order to leave comments, you need to log in
How to make the same object behave differently in different scenes?
Do I need to write separate scripts, or is there another optimized option? Type in one script to check what behavior is necessary for example boolean variable.
Just wondering if there are other options, or should I copy the same code several times so that the player behaves a little differently in different levels? That is, the code is generally the same, only a few lines of code have been changed.
I did a 2D platformer (frozen), now I'm making a clone of Ping-Pong with some other mechanics. This game is exactly what I need an answer for.
It's just that if I implement all these mechanics simply by copying the code, changing a couple of lines, then I will have quite a few scripts, almost the same. So I realized that this is not the best option.
P:S: Possible solutions.
I was offered this:
Pattern Strategy.
State Controller.
Is there something else similar, and which of these methods is MORE correct?))
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question