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 Panik.Studios · Aug 21, 2012 at 10:07 PM · playerdontdestroyonload

How to Destroy Copies made during levelload?

Got another Noob Brain crusher here.

My end goal: Have trigger collide load new level and assign a previous level int to player (working) Have the player spawn in an according position based on that int (working)

I dont want to destroy my player on level load, so I have this script attached to my player

 function Awake(){
 
 DontDestroyOnLoad (this);
 
 }

My problem is as I had already expected. When I return to a previously played scene. I have my non destroyed player (at appropriate location), and a player that spawns in where I originally started.

How do I go about destroying the unwanted player? Any help would be appreciated.

Comment
Add comment · Show 1
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 Panik.Studios · Aug 21, 2012 at 09:30 PM 0
Share

I Notice if I go to the newscene, back to the original.. there are 2 players.. but if I navigate both of them together back again to the second scene only two are there there is no 3rd player in the scene.. $$anonymous$$y thoughts.. If I do a menu scene or player select scene then when I start the game everything will be alright.. Let me see if this is a solution.. Sorry for posting b4 thinking.. still any suggestions would be boss!! Peace

2 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by OperationDogBird · Aug 21, 2012 at 10:19 PM

You should have a variable for the new position already, so instead of spawning a new player, just move the one you already have to that position.

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

Answer by Panik.Studios · Aug 22, 2012 at 12:55 AM

Yep that's the way I have it.. I just made a menu with he player and so the duplicate player is left at the menu. It's the best temporary fix I can think of.

Comment
Add comment · Show 2 · 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 Matt-Downey · Aug 25, 2012 at 11:12 AM 0
Share

add comments under the answers you want to respond to: don't make an answer to comment on another answer.

avatar image Panik.Studios · Aug 25, 2012 at 07:46 PM 0
Share

Well, my comment also has the answer in it So you should upvote to fix my $$anonymous$$arma. Down Voting is for when people post something that is either completely misleading or irrelevant.. I assumed people would see that reasoning when I switched that which was originally a comment to an answer. I didn't want to post several times to cut the moderators some slack since it was late and only one person was around. I accepted ODBs answer only cause he lead me to the realization of putting a character in a menu.. It's still an open ended question though.. because I dont want to have my character in the menu. Still it is an answer and the answer is obviously correct because I asked the question originally and found this to work (as a temporary solution). Which in my opinion gives you no right to up or down vote to begin with, and even if I did post an answer by mistake that was intended to be a comment.. It's not a reason to punish me.. You gotta not abuse your powers otherwise the $$anonymous$$arma system is no better then letting trolls post whatever they want.. I'm here being serious and I expect others to be also.. I want to roll up a newspaper and bonk you on the nose with it right now.. "Bad $$anonymous$$att Downey".
Not to mention the fact that this is Q&A and my question was not, when should I post a comment as opposed to an answer.. You were here just trying to cause problems not answer my question which already had an answer.. That's like trolling man. Or trolling for reasons to troll. Gotta behave!

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

Player using Dont destroy on load 1 Answer

Walking between scenes 1 Answer

Removing duplicates with DontDestroyOnLoad 0 Answers

DontDestroyOnLoad() Unity 3D 0 Answers

Setting Player positioning on a different loaded scene with Dont Destroy On Load attached. 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