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
2
Question by Justei · Apr 17, 2013 at 01:04 AM · photonfps controllerismine

PhotonView controlling multiple FPS Controllers

Hello, I've been trying to make a multiplayer test using the standard FPS Controller, and photon. I've completed the examples in Photon, but am still having some trouble figuring this out.

The problem I have is that when I spawn more than 1 client, they control eachother. From what I have understood, I then need to use the following code:

photonView.isMine and check if the current photon view is mine, and then re-enable "MouseLook", and the other controlling components of the FPS Controller.

But unfortunately I'm out of luck, and am having serious troubles getting this to work.

Since I haven't been able to find anyone that has actually done this and published a working sample, I would love if someone would just download my sample project, took a look, and if you can get it to work, explain to me what I did wrong.

This would also let the next person that gets stuck on this figure it out a LOT faster and not waste hour upon hour like I have.

DOWNLOAD LINK

http://rigid-soft.com/NetworkingNew.rar

If you manage to get this running (which should be very trivial to do if you know how to do this. Please explain and if possible leave some comments laying around :).

TL;DR

I need help with getting a FPS Controller working with Photon, I included a project. If you have the knowledge, please download it, help me, and I would be extremely grateful :).

UPDATE

I managed to fix it, and have uploaded a working sample (without photon network, you need to import that yourself from the asset store).

http://rigid-soft.com/NetworkingNew_Updated.rar

Comment
Add comment · Show 2
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 robensam · Oct 16, 2013 at 04:12 PM 0
Share

Hello, is it in any way possible to get the project that works, the link doesnt work anymore . It seems im suck at the same place. All seems fine until the second player joins. Thanks.

avatar image ggunhouse · May 01, 2014 at 02:29 PM 0
Share

Hi, I'd like to see what you did, too, since I think I am trying to accomplish the same thing. Can you make this file accessible again, or fix the link? Thanks.

1 Reply

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

Answer by iwaldrop · Apr 17, 2013 at 01:35 AM

You're definitely on the right track, and Photon is really easy once you get the hang of it. Photon actually comes with some sample scenes that demo what you're trying to do. Check the marco polo scene, or the worker scene.

Essentially, however, you want to make sure that your Player Objects have PhotonViews. Then, in start or awake, you want to do the following:

 PhotonView pv = PhotonView.Get(this);
 
 if (pv.isMine)
 {
     // initialize whatever you need to for the LOCAL player
 }
 else
 {
     // destroy or disable things for REMOTE players
 }
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 Justei · Apr 17, 2013 at 10:22 AM 0
Share

Thanks for answering! The result I am getting currently is that I do connect properly, and I do enabled the scripts properly. However, now when I move the controls of one of the players, the other one moves ins$$anonymous$$d. And viceversa. $$anonymous$$y current setup is that I run this script on start to connect to a room etc and instantiate a player: http://pastebin.com/9gcHbsCi And then, attached to the player prefab I have this: http://pastebin.com/DaVt$$anonymous$$JBu

One thing I did notice in the other examples is the isControllable variable. And as far as I know, that was added in the tutorial for $$anonymous$$arco Polo, is that a necessity to add for this as well? To avoid this problem?

avatar image Justei · Apr 17, 2013 at 10:45 AM 1
Share

I figured it out! The problem I was having was partially what you described, but also the fact that I wasn't enabling and disabling the camera for the FPS controller, making the camera send updating data to the other players.

I am going to update my post with a downloadable project containing a working sample for anyone that has trouble in the future :).

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

14 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 avatar image avatar image avatar image

Related Questions

Photon Problem 0 Answers

Using Photon to Send Screenshot to other Players 0 Answers

Controlling the wrong client with Photon Cloud 3 Answers

Photon Networking - Getting RoomList inside a Room 1 Answer

"NullReferenceException: Object reference not set to an instance of an object" 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