How to spawn at the door you used when changing scenes?

I’m working on the main town of an rpg that has multiple buildings like shops and a town center. And I made a code that allows the player to go up to a door (where a trigger collision is) and press E to change scenes. Now my problem is that when the player leaves, they spawn at the start of the town no matter what building they come out of. So what is the proper way of making these changing spawn points? I’ve read about making a master game object that has a DontDestroyOnLoad script and using door IDs but I don’t really understand how that works. Any help is appreciated! :slight_smile: (I use C# btw)

for me easiest would be to set positions of spawn points (town entrance, inn entrance, etc…) and when exiting store where from he exited, upon loading town scene it checks entering town location (from inn for example) and spawns/teleports player there. you can do something like manager and store he left from inn and dontdestroy so data gets to next scene, if that is what you are looking for

This sounds like exactly what I’m looking for, but I’m confused on how to apply it. Is there a command to read and save what trigger he used? Then do an ‘if’ statement?

you can define in town script or town manager spawn locations like (inn is at 25,30,60) and maybe even give some rotation (away from inn), then have manager with some int variable. When leaving inn store in int representation of inn lets say 1 represents inn, when loading town scene it reads 1 (you came from inn) and teleport/spawn player at spawn point of inn you predefined at start

What is the reason you need to change scene?

There’s no reason to change scene. You could make a scene with the interiors and exteriors within it and the action of triggering door could ‘teleport’ the player to the building interior. transform.position is your friend.

it sure is, this is in my opinion one of the better ways, we had about 20 levels, which was 20 scenes, and went through this, and using a teleport type worked the best, because what can happen, when he appears in the other scene things can go missing, we never needed don’t destroy, or load etc when using teleport…

Ok I think I’m starting to understand

This does seem more efficient and easier but I plan on the game being mobile, and since this is my first game I wasn’t sure about the limitations of a phone. Do you think a scene like that would be to big for a phone?

I

if it is 3d i dont think it maters much as that is not rendered if far enough i think
If 2d, it should not be problem if world is not too big or if you manage tiles of bigger world good enough.
I alone dont prefer scenes ans if can i try to avoid it but for rpg with bigger world you would need more than one scene so why dont make new scene for inn also.
Also first game open world rpg? Didnt you a little bit overshot?

My first attempted game is a skyrim style open world party based adventure type simulation rpg with strategy and sim elements as well as fps style combat dungeon crawling and multi continent aspirations. I have no programming or 3d modeling background and am learning as i go busy with 3d moddeling now. Do you think i might been overshooting lol?.

Well, I’m doing it in sections while doing the tutorial games to learn fundamentals. Plus my original “dream” is a VR rpg to play local multiplayer. So I’m using the Google Cardboard SDK. To make it easier though I’m trying to break the game up into two parts: environment and living things/systems. The living things/systems like NPCs and stuff is gonna be SUPER hard to learn from what I can tell. And it probably will be more towards instance gameplay than full open world.

I’m right there with ya man

Ha i actually split my project into two projects one half has the enviroment housing etc the other the characters etc so yea maybe great minds think alike:smile:

Lol hopefully this means we’re doing it right then!

How can it be wrong when it feels so right.

You. You’re right.

it depends on your motivation but the fact is that after some time one, two or four weeks of creating and no product most people lose motivation and just quit. Creating smaller products you can finish will be best as you dont have to learn so much in such small time period, you will feel better for having done something and creating big project from start leaves you with tons of questions and ends with crushing big dreams. MAYBE you are part of that one small small precentage that start big and dont quit but still very small chance

11 months so far nothing really to show for but found out a lot of ways how not to do things.Had to start over 3 times maybe more due to taking a incorrect approach .

11 months of active development? wow i hope it succeeds, but just to mention that taking too long to create game is also bad, you may want to look for help if you need 11 more months.