Cant get inputs to work (solved)
by Justen Von Demleux · in Torque Developer Network · 08/29/2011 (12:51 pm) · 1 replies
i cant seem to get any of these inputs to work,
function moveLeft( %val )
{
$moveLeft = %val;
}
function moveRight( %val )
{
$moveRight = %val;
}
function moveForward( %val )
{
$moveForward = %val;
}
function moveBack( %val )
{
$moveBack = %val;
}
function setupInputs()
{
echo("Starting setupInputs Function");
$moveForward = 0;
$moveBack = 0;
$moveLeft = 0;
$moveRight = 0;
if ( isObject( moveMap ) )
moveMap.delete();
new ActionMap(moveMap);
activatePackage(KeybindPackage);
moveMap.bind( keyboard, w, "moveForward" );
moveMap.bind( keyboard, s, "moveBack" );
moveMap.bind( keyboard, a, "moveLeft" );
moveMap.bind( keyboard, d, "moveRight" );
deactivatePackage(KeybindPackage);
echo("Finished setupInputs Function");
}
The echo's are displaying in the console so the function is being properly called. but my key binds just don't call the move functions when pressed, any ideas? Ive had this working before so im obviously just not seeing something.
Any help appreciated.
function moveLeft( %val )
{
$moveLeft = %val;
}
function moveRight( %val )
{
$moveRight = %val;
}
function moveForward( %val )
{
$moveForward = %val;
}
function moveBack( %val )
{
$moveBack = %val;
}
function setupInputs()
{
echo("Starting setupInputs Function");
$moveForward = 0;
$moveBack = 0;
$moveLeft = 0;
$moveRight = 0;
if ( isObject( moveMap ) )
moveMap.delete();
new ActionMap(moveMap);
activatePackage(KeybindPackage);
moveMap.bind( keyboard, w, "moveForward" );
moveMap.bind( keyboard, s, "moveBack" );
moveMap.bind( keyboard, a, "moveLeft" );
moveMap.bind( keyboard, d, "moveRight" );
deactivatePackage(KeybindPackage);
echo("Finished setupInputs Function");
}
The echo's are displaying in the console so the function is being properly called. but my key binds just don't call the move functions when pressed, any ideas? Ive had this working before so im obviously just not seeing something.
Any help appreciated.
Torque 3D Owner Justen Von Demleux