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
1
Question by Jaywalker · Jul 05, 2010 at 02:39 PM · animationprefab

Component on animated object while keeping the prefab

Hey!

I have an animated object (animated in an external program) And on certain parts within this objects hierarchy I would like to add components.

Within the project folder in Unity I cannot see the entire hierarchy.

I can of course just drag the component on the object(in its hierarchy) when its in the scene but then I lose my prefab connection.

so for instance: if the object was a arm and I would like a box collider + script on the hand, what would be the best way of doing this without losing the prefab connection ?

And if that's not possible, would it be possible to make an editor script that adds the required components ? or maybe add the components at runtime ?

Any point in the right direction would be awesome!

thanks a lot!

cheers,

Vin

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

2 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by TaigaStudios · Jul 06, 2010 at 08:00 PM

Edit what you need and add more components etc and make it a new prefab, and delete old one.

Comment
Add comment · Show 2 · 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 Jaywalker · Jul 06, 2010 at 09:10 PM 0
Share

Hey! thanks for the reply. If i make it into a new prefab will it still update if i change the original file in $$anonymous$$aya? so if i add objects to the maya scene does the prefab get updated? thanks!

avatar image Jaywalker · Jul 07, 2010 at 11:53 AM 0
Share

Tested it out and it doesn't seem to update with the maya file. I guess i'm going to research how to build editor scripts to optimize the workflow. thanks again! Cheers

avatar image
0

Answer by microp · Jun 08, 2011 at 03:29 PM

I think this question might contain the answer you're looking for.

As a complement, what I do in this sort of case is to create a public GameObject variable named, for instance, "HandScriptObject", in the parent's script. Into that slot you drag the hand object you want the script attached to. You can then programmatically add the script component to the hand object in Awake(), or instantiate an inspector-exposed prefab and parent it to the hand.

Don't hesitate to experiment with GameObjects! I found out that you can work your way around a lot of problems/limitations by using the right hierarchy setup.

Comment
Add comment · 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

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

1 Person is following this question.

avatar image

Related Questions

Prefab and creating objects in script help 1 Answer

Prefab animation only plays on first instance 1 Answer

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

Attaching scripts to Prefab objects... 1 Answer

Empty animation clips when copying to Prefab 1 Answer


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