Looking for an efficient way to use Raycast for many objects in a scene
So I'm designing a room which contains more than 30 gameobjects and each would give different results whenever the player casts a Raycast on each one of them (unique flying text, unique interaction or animation, etc.).
Right now, I'm thinking of including each object in one script and attach this script to the player gameobject. However, I'm imagining the script would be chaotic in that case but I can't think of any other way.
Also, the game would include many levels and each would contain its unique objects. Surely, It won't make sense to feed that poor script with hundreds of gameobjects, if not 1000, for the entire game.
please help.
Your answer
Follow this Question
Related Questions
How can i get the height of an object 2 Answers
interact objects images or canvas 1 Answer
scrolling canvas script on scene wont play the second time scene is loaded. 0 Answers
Finding unique interacting function within gameObject 0 Answers
Avoid using GetComponent to check if RayCast hit is interactable 0 Answers