Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


aspect

The aspect ratio (width divided by height).
Read time 1 minuteLast updated 6 days ago

Definition

  • Type: Property
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule
public float aspect { get; set; }

Remarks

By default the aspect ratio is automatically calculated from the screen's aspect ratio, even if the camera is not rendering to full area. If you modify the
aspect
ratio of the camera, the value will stay until you call camera.ResetAspect(); which resets the aspect to the screen's aspect ratio.
Additional Resources: camera component, Screen class.