Game Development Community

Creating an Interact Key

by Eric South · in Torque 3D Professional · 11/08/2012 (4:25 pm) · 2 replies

I'm currently working with the Chinatown FPS tutorial and had an idea of adding an NPC that would allow the user to "buy" ammunition and guns.

To do this I'll be creating an "interact" key like is found in lots of FPS-genre games. I know how I'd bind the key, however I'm not sure how the function to actually interact with an object would work. Searching the forums, I found a couple threads pointing to an old resource, but the link to the interact script itself was broken. Does anyone know if there is an updated similar resource around?

I COULD write it myself, I suppose. Though I'm not sure how to go about it. I assume I'd have to cast a ray at the object and check if the object had some sort of interact listener attached to it?

Anyone have recommendations of where to look or ideas on how I'd construct this?

#1
11/08/2012 (4:59 pm)
have a look at this code
www.garagegames.com/community/forums/viewthread/88741
I think you can get a good start on what you want by looking at this :-)
#2
11/08/2012 (6:17 pm)
This is definitely the kind of thing I needed. Thank you!