- Home /
How do I rotate the scene view around the Z-axis
My game is in 3D mode. It is a top-down game where the Z axis is the 'gravity' axis (not sure if that matters). The point being that I cannot for the life of me figure out how to keep the view looking downward while rotating (or orbit) the scene view around this axis. Hopefully the picture helps.
I want to be able to keep a top-down view while looking at this ship from the left.
I don't believe you can. Why not make it actually top down, i.e. have the gravity on the Y axis and have the camera above?
SceneView still uses a camera, so you can make an editor script that alters the camera itself, and to access it you would simply need.
Camera camera;
camera = Camera.current;
// alternatively
camera = SceneView.currentDrawingSceneView.camera;
Then you can alter the cameras position, rotation, and LookDirection like you would any object with a Transform.
Answer by ksakins · Mar 21, 2017 at 09:53 PM
Thanks for the responses. It was as I feared -- I started out creating my top-down game using a tutorial (ironically put out by folks at Unity) which had me switch the Y & Z axes for the sake of simplicity when thinking in terms of moving your player along the X & Y planes. However this ended up causing more headaches down the road when I started dealing with the editor camera, gravity, scaling, etc.
RobAnthem's answer looked somewhat promising, but I didn't really want to continue down the road of fighting the way Unity's coordinate system works. In short, I went back and flipped my axes back to Unity's default. It was somewhat of a pain and took me a couple days, but it's working now and I feel better about the decision to bite the bullet and make the change.
Answer by Akulist · Apr 04, 2019 at 07:43 PM
Hi! Faced the same issue and finish with handful script wich does the job. Hope it'll help someone.
https://forum.unity.com/threads/change-scene-view-camera-rotation-axis-from-y-to-z.649624/ The general idea is to look at Unity's own SceneViewMotion.cs
I'm having this same exact problem. I'm fairly new to Unity and I was wondering if you could explain how I would actually go about implementing this? I can't find any script called SceneView$$anonymous$$otion.cs anywhere.