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 Maras · May 16, 2015 at 03:50 AM · prefabcanvas

Canvas prefab references keep getting lost after Editor restart

When I restart editor, the references inside prefab which is using Canvas element is keep getting lost for some objects.

All references are lost - images are empty white spaces, script is not referencing children and text field get reset.

It happend with two objects:

First Object:

  • Empty GameObject with script referencing both text fields
    • GameObject with 3D model

    • Canvas
      • Image 1 referencing sprite from assets

      • Image 2 referencing other sprite from assets

      • Text Field 1

      • Text Field 2

Second Object: (ment to be child of Canvas)

  • Empty Object with Canvas rendered and script referencing text fields
    • Image 1

    • Image 2

    • Text field 1

    • Text field 2

I somehow managed to make both prefabs work, but sometimes when I edit it and restart Editor, all references are lost (even the one which was working before) and I have to start from scratch.

I have used the same approach in different project and it was working as expected without any reference losses.

Any idea why it might be?

Thank you!

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 Maras · May 15, 2015 at 11:46 PM 0
Share

Just Ctrl + S (save scene). Project should be saved after closing editor.

Anyway other prefabs works fine :-/

avatar image Webnit · Aug 23, 2015 at 06:19 PM 0
Share

I just had the same problem, my data in my canvas keeps resetting. Hope anyone has an solution.

Gr.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by malkere · Aug 23, 2015 at 06:33 PM

I've had this when using data on usb devices where the editor would seemingly load before certain data made it to it, or after sleeping my laptop with unity still running, etc.

ultimately I stopped setting anything and everything in the editor. I do it all by script now using transform.FindChild. That way there is no chance of it ever failing. This brings up the problem of sometimes one scripts Awake() has yet to be called to set a public transform though another script wishes to use it. This too can be fixed via scripting or by changing the load order in the editor.

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Prefab Invisible on Canvas 0 Answers

On Click paramaters disappear from button prefab? 5 Answers

Cannot Set Sorting Layer Name in Nested Canvas Prefab 0 Answers

How to set the UI Text position to be relative to his "grandfather" prefab 0 Answers

Disabling Canvas Prefab only turns off prefab, not in scene canvas 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