CHAPTER 14

Image

Unity Raycasting

Collision detection as shown in the last chapter is an easily accessible way of driving interactions in Unity. It’s easy to think of triggers as triggering specific events or commands, and setting these things up is simple. However, there are some clear potential drawbacks, the biggest of which is something called frame miss.

Frame Miss

Unity looks for events on frames. If a game is running at 30 frames a second, Unity is checking for and potentially firing commands 30 times each second. Frame miss is a term that refers to actions (like a collision detection) happening between frames. If it happens between frames, ...

Get Creating Games with Unity and Maya 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.