How should I be organizing my Raycast Script?
I have a basic raycast script that is getting long. It basically detects what the player is looking at, and then performs some actions based on what we are looking at. This includes swapping out UI elements and all kinds of stuff. I am not sure how to organize this, because it is getting spaghetti-y, and this is happening in multiple places throughout my project.
I think the problem is that SO much stuff needs to know what the player is looking at, almost everything depends on it.
So do I make a huge raycast script that runs methods from a ton of other referenced scripts, or do I have a ton of other scripts all with a reference to the raycast?
Comment