Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 Nodgorod · Oct 08, 2016 at 07:13 PM · photonsynchronizationclients

Synchronization in Photon, I have a scene where I dont instantiate anything, but I want it to update its status constantly on all clients

Hi, I am further developing my game and basically I am having now a quite easy part to deal with. As aforementioned in the question title, I have a scene where there are no player objects to be instantiated. All clients are able to interact with the elements of the scene using the GUI Buttons and when one client pushes a button, I want the update to be smoothly synchronized on all clients. I have added a Photon View Script to the elements I want synchronized, still they start to behave strangely unaccordingly to the physics system ( for example, on one client screen they start floating and bouncing irregularly, whereas on the screen of the client that gave the input from buttons, everything goes as expected.

I have made some research, but I am afraid it would help mostly in the case where I had multiple players objects which is not here the case I suppose. Has my problem anything to do with my camera, or with my network stream?

Please, take into account everything I have mentioned and should you have any other further question, ask here. Any tips, links, even scripts!! are welcome!

Comment
Add comment · Show 5
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 SPOTNINJADUD7890 · Oct 08, 2016 at 10:26 PM 0
Share

Well i need more information like scripts and thinks. I might be of help if you provide scripts and screenshots of your photon views because i am currently using photon view myself but i need more information.

Also are you using RPC calls when doing actions like moving or destroying something?

also what component is the photonview observing?

avatar image Nodgorod SPOTNINJADUD7890 · Oct 09, 2016 at 06:13 AM 0
Share

using UnityEngine; using System.Collections;

public class Network$$anonymous$$anager : $$anonymous$$onoBehaviour {

 const string VERSION="v0.0.1";
 public string roomName="$$anonymous$$yRoom";
 public string playerPrefabName="Interactable Object";
 public Transform spawnPoint;
 void Start () {
     PhotonNetwork.ConnectUsingSettings (VERSION);
 }

 void OnJoinedLobby()
 {
     RoomOptions roomOptions = new RoomOptions (){ IsVisible = false, $$anonymous$$axPlayers = 4 };
     PhotonNetwork.JoinOrCreateRoom (roomName, roomOptions, TypedLobby.Default);
 
 }
 void OnJoinedRoom()
 {

     Debug.Log ("It has entered");
 }

 void OnJoinedFailedRoom()
 {
     Debug.Log ("It has not");
 }

 void OnGUI()
 {
     GUILayout.Label (PhotonNetwork.connectionStateDetailed.ToString ());

 }

}

avatar image Nodgorod Nodgorod · Oct 09, 2016 at 06:15 AM 0
Share

The photonview is viewing all the objects that are supposed to be affected by the input from the buttons. For example, supposing I have a cube object in the scene and by pressing the button, I would like it to execute a jump. The same jump should be visible smoothly on all client objects, thing that unfortunatelyhas not happened yet.

Show more comments
Show more comments

1 Reply

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

Answer by SPOTNINJADUD7890 · Oct 09, 2016 at 05:02 PM

Well you need to use calls over the network in the functions that do the stuff you want to sync. aka RPC calls

Comment
Add comment · Show 3 · 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 Nodgorod · Oct 11, 2016 at 07:16 PM 0
Share

Hey, I was wondering whether you could give me a brief script of a such RPC call for Photon, in the case of an AddForce function, where all the players could see when a cube gameobject gets knocked back whenever a client presses a button. I've studied the RPC calls and now I'm going to put them into practice.

I am sorry if I bothered you with so many questions, but Photon is such a large topic for me at the beginning.

avatar image SPOTNINJADUD7890 · Oct 11, 2016 at 09:46 PM 0
Share

all you have to do it have the photonview observe the transform :D

avatar image Nodgorod SPOTNINJADUD7890 · Oct 12, 2016 at 08:02 PM 0
Share

thank you for you advices, they really proved useful!:)

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

Photon synchronization on different devices failes 0 Answers

Photon client objects behave strangely when colliding 0 Answers

Photon synchronization on different devices failes 0 Answers

Synchronization in Photon, I have a scene where I dont instantiate anything, but I want it to update its status constantly on all clients 0 Answers

Photon Unity Networking (Viking Demo) Error: Argument is out of range. 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