Hi all! I need help to make text appear when a player is in a certain room in my game, but I don’t know what to use to do this. If someone could tell me what to use for this and maybe come up with tips to write the script, that would greatly be appreciated.
Take a look at these answers, they have exactly what you need, especially the first one:
However, in Update(), instead of checking if a mouse button is clicked and a raycast hits something, you just use OnCollisionEnter() and OnCollisionExit() (Or OnTriggerEnter()/OnTriggerExit().
Hello,
Depending on how your “rooms” are set up, you have two options:
- Use Triggers (A collider with
isTrigger
set tottrue
) - Use Math (Mathematically calculate whether the player is in the room)
I’m sure there are many others and it really depends on the situation/environment, which you haven’t specified. To get more concrete answers you should be more precise in your questions.
Hope this helps,
Benproductions1