Mouse, bind and x(y)axis
by Thomas Bang · in Torque Game Engine · 01/13/2009 (11:48 am) · 3 replies
Hi
I have a little problem with mouse bindings. The code looks like this...
When i move the mouse the two strings "YAW executed" and "PITCH executed" should be in the console.
I looked at the scripts from starter.fps but there is no difference to my script.
Is there a problem with xaxis and yaxis? Whats wrong?
I have a little problem with mouse bindings. The code looks like this...
if (isObject(am_player))
{
am_player.delete();
}
Canvas.hideCursor();
Canvas.CursorOn();
enableMouse();
new ActionMap(am_player);
am_player.bind( keyboard, w, playerMoveForward );
am_player.bind( keyboard, s, playerMoveBackward );
am_player.bind( keyboard, a, playerMoveLeft );
am_player.bind( keyboard, d, playerMoveRight );
am_player.bind(mouse0, xaxis, yaw);
am_player.bind(mouse0, yaxis, pitch);
am_player.push();
function yaw(%val)
{
$mvYaw += getMouseAdjustAmount(%val);
echo("YAW executed");
}
function pitch(%val)
{
$mvPitch += getMouseAdjustAmount(%val);
echo("PITCH executed");
}When i move the mouse the two strings "YAW executed" and "PITCH executed" should be in the console.
I looked at the scripts from starter.fps but there is no difference to my script.
Is there a problem with xaxis and yaxis? Whats wrong?
Torque 3D Owner Thomas Bang