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 Kaji-Atsushi · Mar 14, 2013 at 08:23 PM · savegameobjects

How to save positions of many instantiated objects during runtime into the editor?

Hello Everyone, In my current game scene, I have a hundred or so gameobjects instantiating during runtime by script. Some objects are being positioned by the RigidBody Component until they are settled. What I want to do is find a way to memorize/save the position of all these objects. I don't want users to have to wait and run their CPU for these objects to settle in the correct place on the scene. Before they can begin playing on my map. Also, Is it possible to save the runtime instantiated objects so that if I pressed the stop button on the editor. They would remain in my scene, allowing me to edit some of the objects positions?

I'm guessing the best way to do this is to first use some script to safe all the positions into a file with an array. Then somehow have an editor script read that file? then add the objects to scene?

To summarize; How do I save the instantiated objects and positions during runtime, into the editor when I press the editor game stop button.

Any guidance or documentation on this would be great thanks!

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
1
Best Answer

Answer by Polinator · Mar 14, 2013 at 09:22 PM

I had this same problem before, had many balls rolling down a hill and needed to save their positions.

I also thought I needed an array, or a text document saving the posisitons of everything and then writing it again during runtime. Also, there are many programs that you can copy/edit during runtime, then load into the editor.

However, I simply just paused the game where I wanted to get my game objects, then selected all and copy. After stopping, I pasted them all into the hierarchy. This might work for you, too.

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 Kaji-Atsushi · Mar 15, 2013 at 06:18 AM 0
Share

Wow, That was quite a simple solution. I feel like I should have known that by now...This should cover my problems for now

Thanks!

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

11 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

Related Questions

Passing data via script to an editor property doesnt save after Application.savescene 1 Answer

How to save gameobject values with respect to scene? 1 Answer

Can't save script 1 Answer

Saving/Loading Vertices Efficiently 2 Answers

Fastest Way To Save/Load a SkinnedMeshRenderer at Runtime 0 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