One way to do it (I'm sure there are better)
Imagine a button for a door, for example's sake:
Button on a wall that has a child object of an empty gameObject, that's a trigger.
When the player presses e, he sends a message (that doesn't require a reciever) that says "useSomething". When the trigger receives said message, it then sends the required variable change (Boolean might work well; doors are only open or closed, typically).
answered Oct 17 '10 at 06:55 AM