nodrog1061 14 Posted May 23, 2020 i am trying to use a waitUntill to wait for the player to not be on the ground (eg falling) but despite using "not" it still executes the code when the player is on the ground this is my code []spawn{waitUntil {!isTouchingGround player;};}; _freeFallId = [_player,_target] execVM "\SM_tandem_jumping\functions\fn_freeFall.sqf"; player setVariable ["tandem_freeFallId",_freeFallId]; I have also tried using a while loop but it cases way too much lag this is the code I used: while{(velocity _player select 2) > -4}do{ if ((velocity _player select 2) < -3) then{ hint"true2"; _freeFallId = [_player,_target] execVM "\SM_tandem_jumping\functions\fn_freeFall.sqf"; player setVariable ["tandem_freeFallId",_freeFallId]; exit; }; []spawn {uiSleep 2;}; }; I know it's not an error relating to the line !isTouchingGround player as I've tested it in the debug and when I am on the ground it outputs false which it should so this has got me absolutely stumped on how to fix it and what to do. i can give the rest of the code if it helps to s Share this post Link to post Share on other sites
Tankbuster 1746 Posted May 23, 2020 The while condition... is more than minus 4? Shouldn't that be less than minus 4? Share this post Link to post Share on other sites
nodrog1061 14 Posted May 23, 2020 6 minutes ago, Tankbuster said: The while condition... is more than minus 4? Shouldn't that be less than -4? I've tested it both ways still has the same problem it's not a syntax im having its a logic error Share this post Link to post Share on other sites
opusfmspol 282 Posted May 23, 2020 Quote []spawn{waitUntil {!isTouchingGround player;};}; _freeFallId = [_player,_target] execVM "\SM_tandem_jumping\functions\fn_freeFall.sqf"; player setVariable ["tandem_freeFallId",_freeFallId]; The execVM and setVariable are outside the spawn. The waitUntil runs separately in the spawn, and ends with nothing being done. Try moving the execVM and setVariable inside the spawn, after the wait. 1 Share this post Link to post Share on other sites
nodrog1061 14 Posted May 23, 2020 2 hours ago, opusfmspol said: The execVM and setVariable are outside the spawn. The waitUntil runs separately in the spawn, and ends with nothing being done. Try moving the execVM and setVariable inside the spawn, after the wait. Thank you @opusfmspol works perfectly. your a life saver Share this post Link to post Share on other sites