Chapter 12: Completing the VR Game

This chapter continues from the previous one and completes the VR first-person shooter project by focusing on the underpinning code and functionality for creating gameplay, both in VR and using a keyboard and mouse.

Creating and destroying objects is an expensive process. An Object Pool helps to improve performance by retrieving objects from a fixed pool that was previously instantiated at a suitable time (that is, during the initial run or a loading screen). It also aids memory fragmentation by instantiating the objects together in memory in one go. Memory fragmentation occurs when the heap is broken into unnecessarily small chunks, preventing you from instantiating any new objects even if there is enough ...

Get Unity 2020 By Example - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.