Hey, converting some JS code to C#. What gives here?
else if (Application.platform == RuntimePlatform.WindowsEditor || RuntimePlatform.WindowsPlayer) { //error hits here
horizontal = Input.GetAxis("Horizontal");
throttle = Input.GetAxis("Vertical");
}
1 Answer
1
You’re misusing the ‘||’ operator.
It’s supposed to be used like this:
else if (Application.platform == RuntimePlatform.WindowsEditor || Application.platform == RuntimePlatform.WindowsPlayer) {
horizontal = Input.GetAxis("Horizontal");
throttle = Input.GetAxis("Vertical");
}
It's a half-formed statement... else if (Application.platform == RuntimePlatform.WindowsEditor || Application.platform == RuntimePlatform.WindowsPlayer) { ... }
– tanoshimiAh, cheers.
– LordBlackwood