Closed maccxs closed 4 years ago
I think the merge request does this. There is some commented code at the end that can be used to end the level depending on your end game conditions. In my case this was only "endlevel.NotifyPlayerAtHome" which ends the game but it can be something different of course, could also be handled in further function. In that case StartCoroutine(SetPlayerOutOfHouse(p)); would not be called and instead one that ends the level. I used the space key so that the player gets inside/ouside house since I already used that in my level. I think it is good that the user has to press a key to get inside otherwise this might happen on accident. But this has to be explained somewhere (e.g. in the start screen)? Also if we do not use a key to enter and the player is set outside near the trigger, he just gets set inside again. This was a nice morning activity. Thank you.
On the levelmask branch i started this by making a prefab of the house. However, the player cannot get in or out yet.
As I imagine this to work:
The house can be placed on the map and has its colliders on it (the one for the NPCs and the one for the player)
The player can enter the house to be safe for a while
When in the house and pressing one of the arrow keys the player exits the house again to continue its work
The house causes a trigger event when entered which can (as in levelgethome) be used to end the level