Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
  • Help Room /
avatar image
0
Question by Adagio-81 · Mar 12, 2017 at 08:24 PM · animationprefabduplicate

Prefab animations keeps teasing me

Help. I'm going nuts here. I have fixed the problem, but in a very stupid way, but couldn't find a better way. It's do-able at this moment, but if I ever end up in a position like this again I would love to know a better way of handling this problem:

First I created a GameObject (Let's call it Banana) and added all the needed scripts and everything. Also added an animation called IdleBanana. When everything was set up I added this one to prefabs for easy grabbing later Now I needed to create another prefab that was 90% the same as this one (only animation and a few properties was different), so I came up with the brilliant idea: Let's just duplicate the Banana prefab, rename it to Carrot, change the needed properties and drag the Carrot into the scene to change the animation of the Carrot So I played a bit around with the animator by creating a new animation called IdleCarrot and did the animation. In the animator for Carrot I removed the old animation IdleBanana

Here I thought that everything was just perfect. I would now have a Banana prefab with the IdleBanana animation and I would have a Carrot prefab with the IdleCarrot animation. Right? Nope, very very wrong. My Banana prefab now has the IdleCarrot animation

I then tried to pull the Banana prefab into the scene again so I could fix the animation (arrrggg, why can't I easily load an animation into an objects animation). Created the IdleBanana animation again and then in the end realize that my Carrot now had the IdleBanana animation instead of the IdleCarrot

With other words: If I duplicate a prefab, the duplicate and the original are forever bound together. Very annoying

The way I "fixed" it was pretty much by starting over. To be on the safe side I deleted both prefabs, created two new GameObjects in the scene (one for each) and recreated them from scratch one by one. Then at the end I added them as prefabs one by one, so they would not be connected in any way Currently it was do-able as it was simple GameObjects with simple scripts and simple animations, but had it been more advanced I would have gone nuts

What would be the best way to handle a situation like this? Where I have one prefab I would like to duplicate (without any connection to the original) so I wouldn't have to create a new prefab from scratch?

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 IgorAherne · Mar 13, 2017 at 01:10 AM

google nested prefabs

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 Adagio-81 · Mar 13, 2017 at 07:56 AM 0
Share

Thanks, did not know what it was called

Unfortunately after doing a bit of Googling I'm still as confused as before. Everything I have found so far tells me that nested prefabs is not possible in Unity, which is a bit weird considering that my problem seems to be that my prefabs are nested somehow? Or am I missing something? Everybody seems to complain that they can't do what I did, while I'm trying to avoid doing it

I also came across this page: http://devmag.org.za/2012/07/12/50-tips-for-working-with-unity-best-practices/ In tip 20 they tell me to do what I did to have a backup of a prefab, but from my experience this is a very bad tip, considering that the backup and the original prefab are linked together. Changing one of them will change both and if you end up with one messed up prefab, you will now have two messed up prefabs as the backup is also messed up

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

186 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 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

Multiple animations on the same GameObject won't work 0 Answers

Play random animation on an instantiated prefab 0 Answers

Animations created in Runtime 0 Answers

How can I animate my 3D object without affecting the physics? 0 Answers

Should I make completely new animation and animator for every new lift I will create? 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