Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • 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 Eux86 · Dec 07, 2012 at 04:31 PM · gameobjectinstantiatepositioncoordinates

Different child position when parent gameobject selected

Hi all, I'm having an issue with the position of a game object child of another. This is the object hierarchy: hierarchy

I'm dynamically instantiating the "hero" object and then parenting to him the "sphere" objects. After this I move the main "hero(clone)" object containing all its children in the scene.

Everything is good until I have to delete everything, save and then re-instantiate the entire object. The process require me to instantiate the "hero" object again, move it again in the position I previously saved and then put on it my spheres (all this programmatically). It looks good at a first impression but when select the "hero(clone)" object the position of its children change:

left unselected, right selected

(the left part rapresents the unselected "hero(clone)" while the right part the selected.

After I instantiate the "hero" prefab in the scene (becoming "hero(clone)") I set its position and rotation to the saved values and same thing when I recreate the spheres (i save each sphere coordinates). So if the character is not selected everything seems working but when i select it all is children except for the spheres moves to the position where it was originally spawned the first time.

I think it may happen because of something I do during my initialization procedures, but I can't get how is it possible that the same object can store 2 different position coordinates at the same time.

I'm not looking for a solution to my bug in the code (because there is one somewhere, i'm sure) but I'd love to read some ideas about how this can be happening. I tried everything that came in my mind and I have very few alternatives left. So thanks to anyone can imagine a reason why this is happening!

screen shot 2012-11-01 at 3.56.20 pm.png (3.9 kB)
screen.png (122.1 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 Lizozom · Dec 07, 2012 at 04:56 PM 0
Share

I believe I might have had a similar problem here: http://answers.unity3d.com/questions/359688/how-do-i-get-the-global-position.html

avatar image Eux86 · Dec 10, 2012 at 11:09 AM 0
Share

similar indeed, but not the same because I have a direct reference with my instances, I don't find them in the scene. Thanks anyway :)

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.

Follow this Question

Answers Answers and Comments

10 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

Related Questions

Instantiate a GameObject at a position specific to an element that was found in a text 1 Answer

Is gameObject present at coordinates (x,y,z)? 1 Answer

Adjacent Placement of Objects according to varying height 0 Answers

Creating instance of GameObject(Holding component) at same location as object that holds the script 1 Answer

Keep instantiated GameObject's position while parenting it to another GameObject 3 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