Can't get moveMap.unbind to work
by Dean · in Torque Game Engine · 06/09/2007 (4:47 pm) · 3 replies
Here's a simple example of me just trying to make unbind work
function moveforward(%val)
{
moveMap.bind( keyboard, a, moveleft );
moveMap.unbind( keyboard, moveleft );
$mvForwardAction = %val;
}
when I start up, "a" does not make the character move left.
then when I moveforeward, it binds "a" to moveleft, but does not unbind it, and my character will move left. I've tried putting bind and unbind in different functions etc, but I can't figure out how to make it work. Maybe I'm just using it wrong? I've searched and can't find any info on it.
function moveforward(%val)
{
moveMap.bind( keyboard, a, moveleft );
moveMap.unbind( keyboard, moveleft );
$mvForwardAction = %val;
}
when I start up, "a" does not make the character move left.
then when I moveforeward, it binds "a" to moveleft, but does not unbind it, and my character will move left. I've tried putting bind and unbind in different functions etc, but I can't figure out how to make it work. Maybe I'm just using it wrong? I've searched and can't find any info on it.
#2
Or if you want to completely deactivate the moveMap, just pop it from the stack instead of unbinding all keys:
Then push it to reactivate it:
06/11/2007 (2:12 am)
You have to unbind the key, not the command:moveMap.unbind( keyboard, a);
Or if you want to completely deactivate the moveMap, just pop it from the stack instead of unbinding all keys:
moveMap.pop();
Then push it to reactivate it:
moveMap.push();
#3
06/11/2007 (5:09 am)
Ah, thanks. that makes sense now.
Torque Owner Dean