Focus on pivot in scene view since 2017
Hello, I have a question: until (I think) unity 2017.2, I used to focus on a pivot of a game object (in order to create an empty game object at the exact same position), by pressing 'f' 2 times which would make the scene view camera look at the pivot of the object (it was actually equivalent to "lock view to selected").
It seems now that it no longer works, since pressing 'f' two times does nothing, and once just focus on the center, not the pivot, and the only way I found to create an empty gameobject at the position of another is now to first create the GO, then copy the previous transform component and paste it on the new GO... I may have missed something, or could anyone tell me if there is another way to do it? Thanks
Answer by pango · Mar 31, 2018 at 11:35 AM
In case I'm not the only one to have this problem: here is an editor script to make a shortcut that does that:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
public class FocusOnPivot : MonoBehaviour {
[MenuItem("Edit/Focus on Selected Pivot %g")]
static void Focus()
{
GameObject go = Selection.activeGameObject;
if (go!=null)
{
SceneView.lastActiveSceneView.LookAt(go.transform.position);
}
}
}
Made thanks to this thread.
Your answer
Follow this Question
Related Questions
Sprite changes the child local position,Sprite pivot change Vector3.zero postion of child gameObject 1 Answer
Change pivot point of gameobject 5 Answers
Looking for a simple rectangle mesh with corner pivot 0 Answers
scaling object seen only in scene and not game view 0 Answers
GameObject not in hierarchy missing reference to a script 1 Answer