|
Hey, I would like to ask for help, maybe somebody can explain to me how I can create GUI pop up box (text, images and links), which will appear when player hits the wall and disappear when he will move away. For example: I have small town with a few buildings and during the navigation when player will come closer to precise building the info box will appear (which will present info about that building: photos, text and etc.) and when he moves away from the building then info box will disappears. I am kind of new with unity, so I would be glad if somebody can explain me the code which I should use. Thank you ;-) Dzioniux
(comments are locked)
|
|
The code he wrote has an error. The if statements should read: if (theCollider.gameObject.tag == "Player") He never defined other so Unity has no idea what to do with it. Try this simple fix and you should be good. yes, I fixed it. Thank you ;-)
Feb 24 '12 at 05:16 AM
dzioniux
I write an entire script and he gets the tick?
Mar 19 '12 at 07:31 PM
fireomega
(comments are locked)
|
|
one way is you could have two scripts such as the one for the gui which you attach to an empty gameObject. I'm assuming you know how to make a gui box already. Name the object e.g. Info Then make a empty gameObject at the building and attach a collider and make it a trigger. Then write something like: haven't tested it yet, if there are any problems please ask. Hi, First of all, thank you for your answer ;-). I done all steps as you wrote, but I got an error: Assets/collision_info.js(9,4): BCE0005: Unknown identifier: 'other'. Should I somehow define 'other' and my question about "gameObject.tag == "Player" " this means that it will use fps pref. which tag is Player, yes? Best Dzioniux
Feb 23 '12 at 04:14 PM
dzioniux
There is a simple error in the code. The if statement should read like this: if ( theCollider.gameObject.tag == Player") He is using other and since that hasn't been defined Unity doesn't know what to do with it.
Feb 23 '12 at 04:54 PM
melatonin
(comments are locked)
|
