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 angvzp0x · Aug 27, 2012 at 09:07 AM · childclonename

child names of clone dont match model

alt text

if you can see in the attached image, i added 2 gameobj references to the script 'Level_GUI' on 'MainCamera'. the gameobj's are named 'QuadShot'

Notice how the model (in the project view, with the yellow ring highlight) has children named 'CannonBall1,2,3,4' but the clone (visible in the hierarchy view) that is created in Level_GUI::Start() has 4 children named 'CannonBall'

stuff like this is usually my fault - so im not calling it a bug yet, but i cant reason it out

namebug1.jpg (294.5 kB)
Comment
Add comment
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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Bunny83 · Aug 27, 2012 at 10:44 AM

When you clone / instantiate an object, Unity appends "(Clone)" at the end of the name. You can set the clones name when you instantiate the object:

Since i can't determine your language, i start with C#:

 // C#
 public GameObject prefab;
 
 // When you instantiate the prefab:
 GameObject clone = (GameObject)Instantiate(prefab);
 clone.name = prefab.name; // replace the name with the prefab name.


The same thing in UnityScript:

 // UnityScript
 var prefab : GameObject;
 
 // When you instantiate the prefab:
 var clone : GameObject = Instantiate(prefab);
 clone.name = prefab.name; // replace the name with the prefab name.

Note: I used a GameObject reference for the prefab, but it works with Transform, Rigidbody or with any other attached component as well. So you might have to adjust this to your used type.

Comment
Add comment · Show 1 · Share
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 Bunny83 · Aug 27, 2012 at 10:48 AM 0
Share

Ok, i just reread your question and i think you talk about something else :DI never have seen this behaviour before, maybe it's something new in 3.5+

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

8 People are following this question.

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

Related Questions

Instatiated objects should have all the same name. 2 Answers

Access the renderer of a clones child object 1 Answer

Finding a child without knowing its name? 1 Answer

Is a clone object still a (clone) if you change the name of it using script? 1 Answer

instantiated Gameobject trying to access child of child which is a clone itself. 2 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