Quantcast
Viewing all articles
Browse latest Browse all 62

Speed check issue

I am trying to switch between two modes / flight and taxi for an airplane. The problem is I don't want a special key for it. Once the plane speed is over, say, 10, flight mode kicks off. Then, when I return to ground and speed down, once the speed is smaller than 10 the taxi mode should be enabled. The script I made does just that. Only once I complete the routine once - taxi - flight - taxi again - I cannot take off once more. The second it reaches speed 10, it hicks up and resets the speed to zero. I noticed this also happens sometimes from the start, but it manages to get over that moment and take off. Any help is appreciated, thanks! var speed = rigidbody.velocity.magnitude * 2.237; Debug.Log("speed" + speed); if (speed >= 10 && !toggleTaxi) { toggleTaxi = !toggleTaxi; taxiOn(); } else if (speed <= 10 && toggleTaxi) { toggleTaxi = !toggleTaxi; taxiOff(); }

Viewing all articles
Browse latest Browse all 62

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>