View Single Post
  #1  
Old 10-07-2008, 03:10 PM
TrashcanPatrol TrashcanPatrol is offline
Member
 
Join Date: Aug 2008
Posts: 43
Using hotspots to enable opening doors

Hello, I have a question about hotspots. How is it possible to use a hotspot to enable someone to open a door?
What I'm looking for is for the player to walk up to a door, being right next to the door will enable him/her to actually use the command to open the door.

My code is as follows:
Code:
def onHotspot(id,x,y,z):
	if id == door:
             def mykeyboard(key):
  # If the user presses the e key do something
  if key == 'e':
    # Open the door
    door.runAction( vizact.spinto(0,1,0, -90, 30.0) )
		

viz.callback(viz.HOTSPOT_EVENT,onHotspot)
Now, I know that won't work as it is. How can I change it so that the player can only open the door when they're in the hotspot?
Thanks in advance
Reply With Quote