2
\$\begingroup\$

I've been watching tutorials for a good amount of time now, basically just how to create a simple FPS game to get an understanding of the design process in Unity.

The tutorial I watched is very heavily based around the designer, and outside of some simple scripts to handle stuff like raycasting it doesn't involve much coding. My previous experience with game development has been only 2D stuff with XNA, and that was more what I'm used to when it comes to programming, where I'm doing pretty much everything.

I'm having trouble making sense of Unity though...it seems like it's all script/scene based from the programmers side? Like say I wanted to jump from one level to the next, do I just unload one scene and load the next and let the scripts I have for that scene + Unity do its thing?

Sorry if this questions been asked, it's not exactly an easy thing to search for.

\$\endgroup\$
  • \$\begingroup\$ er what exactly do you mean by "script based"? You say it doesn't seem to involve much coding, but scripts ARE code. \$\endgroup\$ – jhocking May 24 '17 at 15:22
  • \$\begingroup\$ @jhocking I guess I meant more in the sense of OOP. I'm using C# but I'm using pretty much no OOP principles, just using it strictly to set what to do based on conditions. \$\endgroup\$ – Demarini May 24 '17 at 15:30
  • \$\begingroup\$ Unity goes out of its way to hide technical complexity because a lot of users are designers and artists, but scripts are pretty much all classes in the OOP sense. That's why you see :MonoBehaviour at the top of most scripts; that's the base class they inherit from. \$\endgroup\$ – jhocking May 24 '17 at 15:39
  • \$\begingroup\$ This also seems like an appropriate time to plug my book, since that is specifically geared at programming in Unity amazon.com/Unity-Action-Multiplatform-Game-Development/dp/… \$\endgroup\$ – jhocking May 24 '17 at 15:40
  • \$\begingroup\$ Note: you can make games in Unity without ever doing any work in the scene view at all. I don't like doing that myself, because it usually ends up in a weird over-engineered manner involving factory-factories, but some people like it. \$\endgroup\$ – Draco18s May 24 '17 at 18:06
4
\$\begingroup\$

Yes, the whole game will run in the objects inside the Scene. Set a new Scene as active, and the last Scene will stop doing its work.

The only exception would be GameObjects that executed this method: DontDestroyOnLoad, those are persistent between Scenes (which is one way to share data between Scenes, like the player's score through the levels).

\$\endgroup\$
  • \$\begingroup\$ Don't forget that you can also choose to load scenes additively, so you can pull in a new scene without deactivating./discarding the current scene(s). Or you can modify a scene in-place for things like procedural generation, rather than needing to bake every possibility into its own scene file. \$\endgroup\$ – DMGregory May 24 '17 at 20:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.