I have a FPS character wandering around a room and finding different objects. What I need to do is to pick-up these objects and allow the character to inspect them. Inspecting them means scaling and rotating in a new screen/scene/popup. After inspection is done, the character should return at his previous state. How would I do this?
Hi @dban. Your “question” is really asking to explain something that has so many ways to go and approach.
There is not right answer to your asking, but kind of doing work for you. You might start from something simple, picking entities, using script components, and interactions between them, etc.
You have to start small, and move forward bit by bit learning how to engineer something as you imagined in the question.
And as you will go on your path to this, if you have specific questions based on what you have tried and something didn’t worked, then we happy to help with pointing you in right direction.
To get a good answer, it is good to be able to ask the right question.
Indeed, my question was not specific enough. I know how to wander around, how to do the picking and how to “inspect” (scale, rotate etc.) the object. I’m guessing that my question is how would I create another scene, the one where the inspection is happening, and how do I switch between scenes.
You could create entity levels and under create for each level entities like: level-1, level-2 etc.
And then you can disable/enable each of them when you need, so that way is basically level switching.
Alternatively you could store level information somewhere else and load it later on when needed.
We actually looking into ‘async’ entities concept, where thing could be loaded later like levels still edited in one world.
I have created more entities representing the levels. The problem is the scripts are loaded even when entities are disabled and more scripts from different levels are doing similar things, like adding mouse events. And in this case they are not working as expected. I could move everything in the initialize method, but how do I “deinitialize” when an entity is disabled?
You can create methods in your scripts called onEnable and onDisable which will be called everything the entity is enabled/disabled. Then you can move you initialization code into onEnable.