Detect Flythrough mode in editor script
Hello,
I am writing an editor script
I need some way to detect if the user is in 'Flythrough mode' as described on this page: https://docs.unity3d.com/Manual/SceneViewNavigation.html
Checking right-click works for the most times, but it sometimes detects false positives.
I tried Tools.current but it doesn't seem to be registered as its own tool.
Something like sceneView.isFlythrough is what I'm looking for
Answer by Aeroxima · Dec 07, 2019 at 11:24 AM
Hey I've been on some kind of epic journey trying to find answers and came across this looking for the same thing. The information doesn't seem to be listed anywhere, in documentation or forums, and nobody responds (as you can see here).
But I found it:
(Tools.viewTool == ViewTool.FPS)
With Tools.current you can see which tool is selected, but [flythrough mode / "3D Viewport/Fly Mode" / FPS mode] is different, and you can use that code above to detect it. (They call it a bunch of things inconsistently, makes searching hard).
See also / example:
Debug.Log(Tools.current);
Debug.Log(Tools.viewTool);
Debug.Log(Tools.current == Tool.Transform);
Your answer
![](https://koobas.hobune.stream/wayback/20220612193856im_/https://answers.unity.com/themes/thub/images/avi.jpg)