• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by VaccineVirus · Aug 03, 2019 at 10:50 AM · positioning

how to change 0,0,0

alt text

alt text

i can keep view position(Y0.4) and change set Y 0?

제목-없음.png (14.7 kB)
제목-없음1.png (143.5 kB)
Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image DCordoba · Aug 04, 2019 at 01:04 PM 0
Share

you can't, however theres is some things that you can do to move the entire escene 0.4 on Y

1) create a empty parent

create a empty object, on the hierachy drag the entire set you want to pul on zero to the empty parent to set it as childs, and finally change parent position

2) do it by editor

press Ctrl+A to select everything, or Shift+Click select the set you want to change, and move manually the green arrow to the desired position

3) do a small script

 using UnityEngine;
 using UnityEngine.Scene$$anonymous$$anagement;
 using UnityEditor;
 
 public class $$anonymous$$oveAll : EditorWindow {
 
     /// <summary>
     /// the direction you want to move the objects
     /// </summary>
     public Vector3 dir = Vector3.zero;
 
     /// <summary>
     /// just move the selected objects
     /// </summary>
     public bool OnlySelected = false;
 
     //code to move objects
     public void $$anonymous$$oveAllObjects(){
         if (OnlySelected) {
             Transform[] SelectedObjects = Selection.transforms;
             for (int i = 0; i < SelectedObjects.Length; i++)
                 SelectedObjects [i].position += dir;
         } else {
             GameObject[] theEntireScene = Scene$$anonymous$$anager.GetActiveScene().GetRootGameObjects();
             for (int i = 0; i < theEntireScene.Length; i++)
                 theEntireScene[i].transform.position += dir;
         }
     }
 
     //visual representation on unity GUI
     [$$anonymous$$enuItem ("Edit/$$anonymous$$ove All")]
     static void Init(){
         EditorWindow window = EditorWindow.CreateInstance<$$anonymous$$oveAll> ();
         window.Show ();
     }
 
 
     void OnGUI()
     {
         dir = EditorGUILayout.Vector3Field("Distance to $$anonymous$$ove:", dir);
         OnlySelected = EditorGUILayout.Toggle ("Just $$anonymous$$ove Selected:", OnlySelected);
 
         if(GUILayout.Button ("$$anonymous$$ove"))
             $$anonymous$$oveAllObjects();
     }  
 
 
 }

just put the script on a $$anonymous$$oveAll.cs file

select the items you want to move, go to Edit->$$anonymous$$ove All

set the direction (inverse that you want to move zero) and press move, also you can move the entire scene if you want (unlock the toggle "just move selected")

  • little warning here, this script wasn't optimized to use $$anonymous$$imal memory, so, if cause problems, delete it after used, and recompile*

I dont know if I just giving you a tank when you need a ant, if there is a simpler solution, I can't find it.

avatar image warthos3399 · Aug 05, 2019 at 03:08 AM 0
Share

I think we dont fully understand the question, and dont see the problem... What are you trying to do?

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

109 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Placing items on terrain in the editor 3 Answers

Object resets position on first movement. 1 Answer

moving the main game window 0 Answers

Multidimensional Array of Vector2 2 Answers

Ideas for car positioning system 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges