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 Theacesofspades · Dec 28, 2012 at 05:04 PM · networkingfpsnot workingonlineswitching

Why when I make a Networking first person game it controls the other person?

So i have been trying to figure out how to make a networking first person shooter for a while now and im getting closer. I now have a menu that asks you to connect, then once you connect it creates you in the game. But my problem is when the second person joins, it switches the controls to where the person on computer 1 will control the person on computer 2 and same for the other way around. Can anyone think of why this is happening?

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 softrare · Dec 28, 2012 at 07:12 PM

That happens because you probably don't make a distinction between local and remote player. The local player has all the movement scripts. The remote player only looks like the local, but does not have movement scripts attached to it (certainly does not answer to key strokes). So when you instantiate the remote player (the player which is not the one which should be controlled by the local keyboard, but a remote human) don't have it scripts attached which listen to key strokes, and make sure it is properly synchronized across the network.

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 Theacesofspades · Dec 29, 2012 at 02:49 AM 0
Share

So what can i do to fix this? Im pretty new to networking.

avatar image softrare · Dec 29, 2012 at 10:29 AM 0
Share

Read this document: http://download.unity3d.com/support/resources/files/$$anonymous$$ultiplayerTutorial.pdf . As said, make 2 player prefabs, one which has scripts on it, that syncronize it over the network (the remote player), and one which is controlled by keyboard, this one is the local player. Depending on the situation you instantiate one or the other. The document should make it pretty clear.

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

Photon enable/ disable object 2 Answers

Getting server status and counting connected players from outside of the server with having the IP address 0 Answers

Spectator Camera (Online) 0 Answers

Network OnServerStart 1 Answer

Unity Photon Virtual Joystick Problem HELP???? 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