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

The magnitude of this vector is typically unimportant as it is automatically normalized, however, if the magnitude is zero then both the Rigidbody2D.SlideMovement.surfaceSlideAngle and Rigidbody2D.SlideMovement.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 Vector2.up.
Additional Resources: Rigidbody2D.Slide and Rigidbody2D.SlideResults.