Skip to content

Instantly share code, notes, and snippets.

View rhys-vdw's full-sized avatar

Rhys van der Waerden rhys-vdw

  • Melbourne, Australia
View GitHub Profile
@FreyaHolmer
FreyaHolmer / SceneViewZAlign.cs
Last active November 27, 2023 11:32
Allows the scene view camera to use Z up/down (be sure to place this script in an Editor/ folder)
// Allows you to change the up vector in the scene view to the Z axis.
// Y-up mode uses Unity's default implementation.
//
// Original code from Akulist on the Unity forums, modified by Freya Holmér:
// • Fixed orbit+RMB zoom not working
// • Toggling will now align the camera immediately to the new up vector
// • When the camera is upside down in Z axis mode, left/right orbit will no longer be mirrored (pls fix this too Unity~)
// • Moved toggle buttons to under the gizmo
// • Fixed broken rotation state when focusing a different window in Unity and coming back to the scene view
//