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 /
avatar image
0
Question by unity_qyNAJ9CdbDf9rw · Oct 11, 2019 at 10:22 AM · data

Gameobject can not save variable attached to it ?

Hello ! I have trouble that I cant save gameobject data. When i restart unity all data attached to gameobject will be lost. alt text

When i save it and restart unity. Something like this happen

alt text

I dont know if there is connection. But i have some error like "Parser Failure at line 51: Expect ':' between key and value within mapping". But i dont know what is it ! Sorry for my bad english ! Thanks for Advice!

untitled.png (25.4 kB)
untitled.png (16.4 kB)
Comment
Add comment · Show 3
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 Hellium · Oct 11, 2019 at 10:42 AM 0
Share

Have you tried to remove the component, restart Unity and attach the component again?


The serializer of Unity may have failed to serialize the gameObject and/or its components attached.

avatar image Bonfire-Boy · Oct 11, 2019 at 11:39 AM 1
Share

It looks more like a YA$$anonymous$$L parsing problem than the C# compilation problem that GubaLord is suggesting.

What version of Unity are you on? A quick google found this which could be relevant...

https://forum.unity.com/threads/case-1161290-parser-failure-at-line-x-expect-between-key-and-value-within-in-2019-3-0.695074/

avatar image GubaLord Bonfire-Boy · Oct 11, 2019 at 05:10 PM 0
Share

Yep, you have right.

1 Reply

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

Answer by GubaLord · Oct 11, 2019 at 10:46 AM

Yes it has connection.

Looks like you have a syntax error in your code at line 51. Find that line in the script (you can double click on the error and unity will take you there). Try to fix the error, or paste your code here so someone can try to fix it for you.

Until you have compile error in your scripts (even if it is only one) unity wont save the assigned fields (Or just wont load them until the errors are fixed? I do not remember, so correct me if I'm wrong).

Comment
Add comment · Show 7 · 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 unity_qyNAJ9CdbDf9rw · Oct 11, 2019 at 12:22 PM 0
Share

Thanks you! But how to find the line in my code ? I try to double click on error but nothing happen. And I dont know, but seem like it only happen with string. When i try to not put string in object. (other int, button ,... have) it seem like save. But when i put 1 string in. Everything is fly away

avatar image GubaLord unity_qyNAJ9CdbDf9rw · Oct 11, 2019 at 05:08 PM 1
Share

The error should describe which script throws it. You can open that script with a coding program or with notepad (not advised). Then you can find line 57 by the line numbers on the left (or counting to it if you use notepad).

To be honest, I looked over your description a little hastily, and I have made a little mistake. Now I see that your error comes in runtime, not at compile. In this case I am not so sure about the connection of it to the field reseting. But fixing an error is never a bad thing :)

avatar image unity_qyNAJ9CdbDf9rw GubaLord · Oct 12, 2019 at 12:37 AM 0
Share

Thanks you! but my error look like this : "Unable to parse file Assets/Scenes/1773.unity: [Parser Failure at line 1954: Expect ':' between key and value within mapping]". I think the error happen to scene not Scripts ? $$anonymous$$y 1773 is a name of scene.

Show more comments

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

113 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

Related Questions

How can I get the PointerEventData included in StandaloneInputModule ? 0 Answers

unity control real world devices 1 Answer

Component Is Heavy 2 Answers

How to access the data in a list that save any class inside 1 Answer

Syncing variables between two objects of same script 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