Joystick?

Blitz3D Forums/Blitz3D Programming/Joystick?

EvilMeowChi(Posted 2004) [#1]
I have a problem, im using Joyx like this

if Joyx() = 1
moveentity whatever,1,1,1
endif

and it doesnt work but if i say

if joyx() = 1 then moveentity whatever,1,1,1

it works, how do i fix the first one?


Stevie G(Posted 2004) [#2]
V strange .. they both do exactly the same thing??? If you let us know exactly what you want to do?


GfK(Posted 2004) [#3]
The first one isn't wrong - it works perfectly here.

Perhaps the problem lies elsewhere in your code? Or maybe the joystick isn't calibrated properly?


Genexi2(Posted 2004) [#4]
I'd suggest you store the value of JoyX() into a floatin-point variable and use the variable for your if statements.....,..cause I have a feeling its cause you're using more than one If statement for the one command.


_PJ_(Posted 2004) [#5]
If the joystick wan't calibrated properly, they'd both show errors. I'm guessing there's some Nested If/EndIf issues. As Genexi2 says, use a float# variable. ie float#=JoyX#()

Also, be wary of checking for exact values with analogous control media. The joystick X-value can be anythin from -1 to +1, so it may be 0.976 or something and not be checked by JoyX()=1