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 CJGames · Dec 11, 2014 at 03:47 AM · errorfpsfixweapon system2 player

Spawning 2 players when the game starts

Well, i'm making an FPS and i tried to make a switch weapons system, but i tried to do it with no tutorials, making the code myself, but i'm not good at coding and i'm not expert in unity, so everything went wrong. Then i deleted every change I made, but now when I start the scene, 2 players spawn, the one that is already in the game, and another that falls from the sky. In game I can see the clone's camera (the one that falls from the sky) but when I shoot the bullets come from the other one. Also walking and moving the camera affect both players, and my AI Enemies attack the original one, and also when they get to close, i can hear 2 bg musics instead of one (cuz the Audio Source is attatched to the Main Camera), how can I fix this? And if there's no fix, there's any way I can...count the amount of players (and if there are more than 1 the rest is deleted) or delete all the clones with the tag "Player" (without deleting the original one)?

Please help, i apologize about my english, and the game is single player, so there's no respawn or multi player system

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

2 Replies

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

Answer by 0mr_ashutosh0 · Dec 11, 2014 at 04:44 AM

Could you please post screen shot of your editor so we can see may be whats wrong.

Regarding Two player spawning.

1) Drag and drop the player which is in 'Hierarchy' to 'Project' tab. 2) Delete the one is Hierarchy. 3) drag and drop player from 'Project' ( it is a prefab now ) To your script.

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 CJGames · Dec 11, 2014 at 04:04 PM 0
Share

Worked :D

avatar image
0

Answer by joemane22 · Dec 11, 2014 at 09:25 AM

Instead of trying to delete the clone you should be looking for where the clone is created. I am guessing it gets spawned in run time so look at the code you wrote to spawn the player and you may find a bug in there. If you cant find it post the source code and maybe one of us can find it.

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

Change Automatic to Semi-Automatic 1 Answer

How to check collision with specific object 1 Answer

FPS SCRIPT ERROR PLEASE HELP 2 Answers

CoD style weapon selection 1 Answer

How i "import" variables? 2 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