void ManageEnergy() { if (isFlying) { energyRemaining -= Time.deltaTime * 2; // Consumes 2/second } else { energyRemaining += Time.deltaTime * 1; // Regenerates 1/second }
// Movement along X (horizontal), Z (forward) and Y (hover) transform.Translate(horizontal, 0, vertical); transform.position += transform.up * upDown; iron man simulator 2 script pastebin
private bool isFlying = false;
public float thrustSpeed = 10f; public float rotationSpeed = 50f; private bool isFlying = false; void ManageEnergy() { if (isFlying) { energyRemaining -=
transform.Translate(horizontalThrust, 0, verticalThrust); transform.Rotate(verticalRotation, horizontalRotation, 0); } } } Z (forward) and Y (hover) transform.Translate(horizontal
[Header("Audio")] public AudioSource thrustAudio; // Jet sound when moving public AudioSource hoverAudio; // Hovering sound
if (energyRemaining <= 0) { isFlying = false; Debug.Log("⚠️ Energy low! Land the suit ASAP."); } }