Version: 2021.3
LanguageEnglish
  • C#

Camera.transparencySortAxis

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Switch to Manual
public Vector3 transparencySortAxis;

Description

An axis that describes the direction along which the distances of objects are measured for the purpose of sorting.

If the TransparencySortMode of the Camera or GraphicsSettings are set to TransparencySortMode.CustomAxis, the rendering pipeline evaluates the distance of the object along the axis specified by this property.

This is used for sorting Renderer components when other, higher priority, criterias fail to distinguish the render order.

This is a useful technique in 2.5D games or isometric games where the SpriteRenderers need to be sorted along the vertical screen axis. For this specific use case, set the TransparencySortMode to TransparencySortMode.CustomAxis and set the axis to (0.0f, 1.0f, 0.0f).