Game Development Community

only use keybind in on levelLoaded?

by rennie moffat · in Torque Game Builder · 02/01/2010 (12:10 pm) · 2 replies

Hi, I am wondering can you only use a keybind in onLevelLoaded or onBehaviorAdd,
or.. Can I use it in any onld function?


The trick is that I am trying to get my "star" to dislodge from my "greySquare", but I only want the command (dismount()) to be active, set, when star is mounted.

About the author

My thanks to Garage Games and the Garage Games Community combined with owned determination I got one game up, Temple Racer and I am looking to build more interesting, fun games for the mass market of the iOS app store.


#1
02/01/2010 (12:41 pm)
You can keybind from anywhere.

However, a better way to do what you are doing would be to either have multiple actionmaps - one for each interface state, or have a state check done within the function called by your keybind command. Otherwise you could quickly run into actionmap and keybind headaches.
#2
02/01/2010 (12:51 pm)
I see, right now I only have one call to command the space bar... which triggers a dismount.