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 /
This question was closed May 21, 2015 at 10:22 PM by redeemer for the following reason:

Problem is not reproducible or outdated

avatar image
0
Question by redeemer · Mar 20, 2013 at 03:39 AM · cameranetworkingplayerphotononline

Photon switches player's camera

Hello,

I'm trying to use the Free Animated Cartoon Soldier from the asset store with photon. I've already set up a scene with everything working fine, as long as I use my own scripts (extended from the ones in the tutorial). But when I try to use the prefab 3rdperson that comes in the package (this one handles everything giving the character more realistic control than mines) when the second player joins the scene, both players switch their cameras but not their movements. With that I mean each player keeps controlling it's own character, but he sees the view of the other player. I've noticed this also occurs, independently of the prefab, when the camera script is not correctly assigned. This is done by the next piece of code:

 if(photonView.isMine()) {
     
     cameraScript.enabled = true;
     
 } else {
     
     cameraScript.enabled = false;
     
 }

Thank you in advance for your time and help.

PD: My first language is not English, so excuse me if I've made any mistakes or typos in the post

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

  • Sort: 
avatar image
1

Answer by moviemastersdk · Jun 04, 2013 at 06:30 PM

I suggest doing all of the Control and Camera setups when you instantiate your Players,

Here's an example from a game I'm working on.

 using UnityEngine;
 using System.Collections;
 
 public class NetworkManager : MonoBehaviour {
 
     public Camera PlayerCamera;
     public GameObject Spawn;
 
 void OnJoinedRoom() {
         GameObject player = PhotonNetwork.Instantiate("player", Spawn.transform.position, Spawn.transform.localRotation, 0);
         PlayerController controller = player.GetComponent<PlayerController>();
         controller.enabled = true;
         CameraController camera = PlayerCamera.GetComponent<CameraController>();
         camera.enabled = true;
         camera.Target = player.transform;
     }
 }
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
avatar image
0

Answer by devoted93 · Jan 12, 2014 at 12:49 AM

What's the CameraController from I'm getting the same error as the guy had originally posted.

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

Follow this Question

Answers Answers and Comments

12 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

Related Questions

Player names all displayed as local player photon 2 Answers

Photon variable synchronization 1 Answer

Local (non network) camera for multiplayer game 2 Answers

Multiplayer| Attaching camera to player (if i am the owner 1 Answer

[Photon] Getting the players in a room in the same order 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