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 valdelievre · Jan 14, 2013 at 12:08 PM · gameobjectpositionreset

Reset GameObject positions

Hello,

I was wondering what was the best way to reset GameObject positions to their initial loading state. basically, When my hero die, the user has the possibility to restart the level. For the moment, i reload the scene, it takes ages ( around 2 secs ).

To make it faster, i was thinking to reset all my gameobject to their initial positions without reloading the scene

Few questions though :

  • how to know if a gameobject has moved when the hero dies ?

    => I was thinking to store all the gameobjects in a list on Awake() then compare their new positions when the heroes dies. However, Do i need to find all my gameObjects again so i can compare initial gameobject state and new gameobjects states ? it might lag a bit to find them all again. I am pretty sure i could do something with the list where all my gameobject have been store when loading the scene.

  • How to re-instanciate some gameobject which have been destroyed?

    => Some objects ( prefab ), could have been destroyed during the game. How would you re-instanciate them when the heroe dies since they don't exists in the scene anymore?

It would be nice if you could share your experiences with that or propose better ideas to do it.

Many Thanks

Florent

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 Ebil · Jan 14, 2013 at 12:13 PM

Its better you make a script to load a level which you have saved before. Examples for that can be found in the Netzwork tutorials. So you basically just load the level again and your hero respawns...

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 valdelievre · Jan 14, 2013 at 02:12 PM 0
Share

Thanks $$anonymous$$. However, i have around 45 levels ( each level is a scene so far ) Could you please point me out a link for the 'Netzwork tutorials' to save a level ?

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

9 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Object Not Centering/Reseting Properly with Grid 0 Answers

Moving GameObject to various position ? 1 Answer

[Solved] How to get non repeating random positions? 5 Answers

The Script keeps executing..instead executing onec 0 Answers

Object's sprite and collider are not at same position as transform 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