Search Unity

Question FPS tutorial with current best practices?

Discussion in 'Getting Started' started by haxan39696, Jul 29, 2021.

  1. haxan39696


    Jul 29, 2021
    I've been able to find a huge amount of information, both free and paid, about building an FPS game from scratch with Unity. It has been great so far, but I'm really not sure if what I'm learning equates to the current best practices of the engine. A lot of the stuff that I've written following the tutorials has been frowned upon by other devs. I'm also reading the forums and I always come across people talking about code/practices that look similar to what I've been following as not the best way to do things.

    So, what is the current state-of-the-art tutorial for FPS games? Is there one? If not, are there any best practices tutorials when dealing with the common features of such a game, such as projectiles, ballistics, raycasts, etc.
  2. Ryiah


    Oct 11, 2012
    Generally speaking tutorials are aimed at beginners and thus are written as simple as possible to make it easy to absorb the information. One result of this is that they will often have practices that can lead to performance loss if used incorrectly.

    The GameObject Find() methods are an excellent example of this. If you only call them once per object to set up variables in an Awake() or Start() method they can be fine to use but if you call them every frame or even every few frames it can lead to a badly performing script.

    Once you've reached the point you can no longer benefit from tutorials the typical sources of information will be resources like these forums, developer blogs, white papers, convention talks like GDC, and so on. For most of these resources code will be sparse if it's available at all.