- Home /
How to make character read a poster in a wall?
Hi, Im trying to make a character face the wall to a poster (texture), push letter "X" and then "read" on the GUI whatever instruction its written there. I am thinking about placing a colider and OnEnter event, fire the GUI. What are the proper steps and code?
While were on it, how can I dim all the lights when the character is reading the note? I supposse I also have to stop any movements from the player until the playr hits the "continue" button (like "x"). Im only using X for this situation. nothing more.
Answer by celadon · Feb 10, 2011 at 01:25 AM
Seems like it would make more sense to raycast from the character so you know they are facing the right direction and how far away they are. Are you using the "x" for anything else? You could listen for the letter press, do the raycast, see if what was hit was the poster, and if so, open the GUI. The poster would need to be a separate GameObject with collider so your raycast can hit it.
Are you using javascript or c#?
Hey, thanks for the idea. I would prefer javascript. Raycast on it sounds like a great solution. Where can I check that kind of code in the tutorials? or if you could please help me with an example. Also, read my comment on the original question to dim lights. Thanks.