Event driven systems
A software engineer’s job is to solve problems. Most of the time, this means special treatment in certain cases to make sure eventualities are handled. Sometimes, perfection is found, and the problem is not solved but erased from existence. In our current system, we want to solve the problem of needing to trace a sphere through our world for the player in every frame.
The question is not, how do we make this more efficient? Instead, we should be asking, why sphere trace? There isn’t really a clear answer to this. Yes, it allows us to check the volume of space for a player, but so do colliders. Yes, we can check all the space between the light mesh and the floor, but in our game, the player cannot jump. Yes, we can tell whether there are objects blocking a view of the player, but so can a cheaper line trace on the frames when we are not sure.
From these three answers, we can form a new solution. In principle, we will attach a sphere collider...