display a message in the game engine when you click an objec

Hi! I’m trying to display some text in a walkthrough (for example when you click some object in the scene) but it isn’t working any help please?

u cannot add text in the game engine u may be able to do it with pythin script but i dont know how maybe somone else like z3r0 d knows?

Here’s a quick & dirty demo how it’s done - the only Python used is to make the cursor show up:

http://www.kainstein.de/downloads/info_demo.blend

well, there is the text object…

the problem doing what you suggest however is the “where the user clicks” part, it is difficult [near impossible] to convert the system’s cursor to a ray sensor

objects can get if they were clicked on however

I think an adequate solution if you are making an fps is simply to have the crosshair be what the user clicks with

that is what I did with the fps controls thing:
http://home.earthlink.net/~nwinters99/temp/fps_controls.blend

now then, text in the game engine is done with bitmap fonts and the object’s Text property
[iirc jd-multi had a good tut on how to set this up]

in my example, the text object is the child of the camera and is set using python to whatever the action you can perform is
[the E key is used for actions…, it could just as easily be the left mouse button or anything else]

so, where should this text be displayed? next to the object, or on the screen?

[either way doesn’t really matter, they are both achiveable about as easily]

Here’s a quick & dirty demo how it’s done - the only Python used is to make the cursor show up:

http://www.kainstein.de/downloads/info_demo.blend

you forgot to pack it

Oops! Sorry! Fixed! :slight_smile:

Hey kEinstein. When I looked at the not text showed up when I put the mouse cursor over the box or whenI click the box. Looking at the box in the game engine screen It has how properteis but the actuators call for it to have a “Text” property. So I insterted one. Still nothing happened.

The Text property is assigned to the plane on top of the box, not to the box itself - and then I connected the controller of the box with a property actuator of the plane to change the Text property.

I made it under 2.34 and it worked fine - though I should have used another font which shows up better. Then I tried it with 2.25 and I don’t know why it doesn’t work there. Perhaps I could have a closer look at it when I’ve got some time.

Besides of that: There are probably dozens of possibilities to do this. Especially if you’re using an own mouse cursor. But the principle is always the same: interconnection between the text object and the object that has been clicked.

Ok now I see it. I think the camera was too far away and the font to small to see it intially. Also I tested it in 2.34 and 2.25 if works for both once I moved the camera closer.