Interacting with things for first person horror game

I want to make it where when I am near an entity I can press e to cause an event like pick up an item or open a passage. Any ideas or scripts would be helpful.

@Brent_Reddick I took a look at what you have so far and it looks great. I have made a little demo code to do this. Actually there are many ways and you can look at some more forum posts if you would like. Here is my example.

In fps-controller script I look for E

// // Process Action keys
    if(app.keyboard.wasPressed(pc.KEY_E)) {

Process a raycast

FpsController.prototype.processRaycast = function() {
    var centerScreenX = / 2;
    var centerScreenY = / 2;

    var start =, centerScreenY,;
    var end =, centerScreenY,;
    // raycast between the two points and return the closest hit result
    var result =, end);

    if(result) {
        var pickEntity = result.entity;

        if(pickEntity !== null) {
            if(!result.entity.tags.has('double')) {
                // Execute Activation

        } else {
            console.log("Nothing Hit");
    } else {
        console.log("Open Space and entity is NULL");


I put listeners in the function for each item that has some type of action and then use the .fire to signal the action.