Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


surfaceUp

A reference direction used to calculate contact angles.
Read time 1 minuteLast updated 12 days ago

Definition

  • Type: Property
  • Namespace: UnityEngine
  • Assembly: UnityEngine.Physics2DModule
public Vector2 surfaceUp { readonly get; set; }

Remarks

Both _surfaceSlideAngle and _gravitySlipAngle use this to determine the surface angle.
The magnitude of this vector is typically unimportant as it is automatically normalized, however, if the magnitude is zero then both the _surfaceSlideAngle and _gravitySlipAngle will be ignored resulting in always sliding and slipping. This can be used for moving in a "top down" view where gravity is not used and slipping is always required in all directions.
NOTE: By default, this value is _up.