Can't bind mouse button to ActionMap
by Cyrad · in Torque Game Builder · 01/07/2010 (5:57 pm) · 1 replies
I can't seem to bind a mouse button to an action map. I prefer to use an action map rather than mouse callbacks for various practical reasons. I want the character to attack by pressing the mouse buttons.
It looks a little strange, but this same syntax worked for the keyboard bindings, but not the mouse button. I searched the forums for similar issues, but all of them were either unanswered or gave a solution for an old version of TGB that doesn't work for the current version.
Any help with this?
playerControls.bindCmd(mouse0,"button0","classPlayer::attack_primary($player,1);","classPlayer::attack_primary($player,0);");
It looks a little strange, but this same syntax worked for the keyboard bindings, but not the mouse button. I searched the forums for similar issues, but all of them were either unanswered or gave a solution for an old version of TGB that doesn't work for the current version.
Any help with this?
Torque 3D Owner Marc Dreamora Schaerer
Gayasoft
That means:
1. Is the function not called at all (short echo("im alive"); at the start helps)
2. Is there an error mentioned in the log?
If I would have to guess then I would guess that the reason is the usage of the variable within the function without enclosing it in eval( ... ) but thas just a guess