Hello,
I’m wondering what the best solution for changing the UI as it hits certain objects is. I have two ideas on how to do this.
- I constantly send a raycast and as I hit an usable object I change the UI to something else.
- I try to do the same thing with collision boxes instead and have a trigger box in-front of the player that when it collides with usable objects I change the UI.
But I’m not sure if this is the best way to solve the problem.
What I want to do is that when a player looks at certain objects I want to show them by changing the UI that this is a usable item. But I do not want this to happen when they are for example looking at a wall. If someone else have solved this same problem please tell me the best way to solve this.