Function running twice?
by NiN-NiN · in Torque 3D Beginner · 03/10/2014 (3:12 am) · 2 replies
I am really confused I have this working perfectly if i call menu() and action() in the console it only pics one and will move onto the next one once $weather variable goes up one.
The issue is as soon as I try to have a keyboard command run it there are issues it seems to run the next command as well so if $weather = 1; it runs that function then runs the next one like $weather = 2;
so i hear the audio for rain then cloud play but it's perfect in the console
I can't work it out this is the keybinds i have
The issue is as soon as I try to have a keyboard command run it there are issues it seems to run the next command as well so if $weather = 1; it runs that function then runs the next one like $weather = 2;
so i hear the audio for rain then cloud play but it's perfect in the console
I can't work it out this is the keybinds i have
moveMap.bind( keyboard, t, menu ); moveMap.bind( keyboard, y, action );
#2
for anyone who's looking this is what I did
You must use if(%val) to check for just the press so it runs once instead of on press and on release
03/10/2014 (7:15 pm)
Thanks Daniel I didn't realise that it has options for on press and on releasefor anyone who's looking this is what I did
function launchmenu(%val)
{
if(%val) {
menu();
}
}You must use if(%val) to check for just the press so it runs once instead of on press and on release
Torque Owner Daniel Buckmaster
T3D Steering Committee