Skip to content

Instantly share code, notes, and snippets.

using UnityEngine;
// FlyBehaviour inherits from GenericBehaviour. This class corresponds to the flying behaviour.
public class FlyBehaviour : GenericBehaviour
{
public string flyButton = "Fly"; // Default fly button.
public float flySpeed = 4.0f; // Default flying speed.
public float sprintFactor = 2.0f; // How much sprinting affects fly speed.
public float flyMaxVerticalAngle = 60f; // Angle to clamp camera vertical movement when flying.