Quantcast
Channel: Photon Unity Networking (PUN) — Photon Engine
Viewing all 8947 articles
Browse latest View live

problem importing assets PhotonNetwork with Photon Chat

$
0
0
after importing the 2 I get this error Does anyone have a solution?

OnPhotonInstantiate callback is not called

$
0
0
I have inherited IPunInstantiateMagicCallback interface eventhough OnPhotonInstantiate callback is not calling ?

Issue with collisions

$
0
0
Hi :smile: First forgive for my low level of English ... :# I'm doing some tests with Fotón PUN on a 2D project where I want to synchronize the movement of 2 square numbers and everything works correctly in terms of movement, although with a lot of LAG. But the real problem is that when objects collide with each other, there is an unnatural movement, the objects begin to vibrate sharply and I do not know why this may be happening. In the Player Prefab I am using the PhotonTransformView and the corresponding PhotonView Does anyone know what may be happening with this? Here I leave a video in which you can check the problem: https://drive.google.com/file/d/1TUQTMBievV9j40XMyairSYlrq4o-POBW/view?usp=sharing Many thanks in advance, greetings. :blush:

Master prefab is not instantiated on client ???

$
0
0
am instantiate my player in both master and client. in master side both the players are instantiated and visible but in client side i cant see the master player ...

Alternative to OnOperationResponse

$
0
0
Hello, i want to get back a response from the webhook playfab, with realtime there is OnOperationResponse but with PUN 2, i can't extend my class with LoadBalancingClient. I guess there is an alternative ? i send with raiseEvent and get back with onEvent when it comes from the others players, but how about this webhook ? UP: OK I've manage to test it and this is exactly the same method which receive the response. But I don't get it, how we differentiate the event received from the webhook and the one from the other client client? Thank you for your time.

PUN2 Loading Screen Problem

$
0
0
Hello, I have recently purchased an asset for loading screen. However, I need to call LoadingScreenPro.LoadScene() instead of PhotonNetwork.LoadLevel(). What should I do? And idea? Thanks in advance.

Player disconnecting too fast on subsequent disconnects

$
0
0
Hi. I am developing an Oculus Go game and any time after the player disconnects by taking off their headset or going to the Oculus Home menu, their next disconnects happens after 10 seconds which is too fast. I am using PUN 2. The scenario is this: 1. First player makes an online room. 2. Second player joins and then goes to the Oculus Home menu by pressing the button on their controller. 3. Second player disconnects after about 1 minute (this is intended I believe since PhotonNetwork.KeepAliveInBackground is set to 60 by default). 4. Second player is kicked out of online. Tries to go back to the lobby menu to re-join the room. 5. Second player goes to Oculus Home menu. This time disconnecting in about 10 seconds. How am I able to make the second, third, fourth, etc disconnects the same amount of time as the first? This seems like a bug.

PUN and room persistence

$
0
0
Hi! I've looked through this topic on forums and all posts I found are quite old. So I'd like to refresh this info. Can I use PUN in case I want to persist rooms after all players disconnect? Does it support the ability to reconnect the game later? I'm going to use Webhooks with Microsoft Azure for storage and will start with Turnbased backend example. What features in PUN can or cannot be persisted? For example, can cached RPCs be stored? Thanks

WebSocket is closed before connection is established.

$
0
0
Hello everyone, I'm having a odd error appearing in dev console.. I can't connect to Photon cloud usign WebGL build.. Everything is set-up correctly, according to guides and so on. (Connection type is set to Web Socket in photon settings). Take a look here: http://playtdpr.4fan.cz/ What may solve this issue? Many thanks and have a nice day :smile:

(2018.3) Add Component not working

$
0
0
Hi, when after updating to 2018.3 i can no long add any components...... So after removing and reinstalling PUN its working again. delete this. I get this errror: ArgumentException: An element with the same key already exists in the dictionary. System.Collections.Generic.Dictionary`2[System.String,System.String].Add (System.String key, System.String value) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:404) UnityEditor.AdvancedDropdown.AddComponentDataSource.GetMenuDictionary () (at /Users/builduser/buildslave/unity/build/Editor/Mono/Inspector/AddComponent/AddComponentDataSource.cs:70) UnityEditor.AdvancedDropdown.AddComponentDataSource.RebuildTree () (at /Users/builduser/buildslave/unity/build/Editor/Mono/Inspector/AddComponent/AddComponentDataSource.cs:17) UnityEditor.AdvancedDropdown.AddComponentDataSource.FetchData () (at /Users/builduser/buildslave/unity/build/Editor/Mono/Inspector/AddComponent/AddComponentDataSource.cs:10) UnityEditor.AdvancedDropdown.AdvancedDropdownDataSource.ReloadData () (at /Users/builduser/buildslave/unity/build/Editor/Mono/Inspector/AdvancedDropdown/AdvancedDropdownDataSource.cs:22)

Sometimes Game Scene is loading twice

$
0
0
So I working on a Multiplayer game. where the user selects environment Dessert/Forest and has a match If no player found then the player will have a match with AI Only in the case of match with realplayer sometimes my environment scene is getting loaded twice, which is causing so many other things to break. I am using this coroutine to load the scene. and I have checked this isn't calling 2 times. IEnumerator ProgressBar() { #if UNITY_EDITOR yield return new WaitForSeconds(0.5f); #endif Debug.Log("inside progress bar"); Time.timeScale = 1; async = SceneManager.LoadSceneAsync(loadScene); async.allowSceneActivation = false; while (!async.isDone) { if (async.progress >= 0.9f) { break; } yield return null; } yield return new WaitForSeconds(0.5f); text3.color = new Color32(255, 255, 255, 255); yield return new WaitForSeconds(0.5f); text2.color = new Color32(255, 255, 255, 255); yield return new WaitForSeconds(0.5f); text1.color = new Color32(255, 255, 255, 255); yield return new WaitForSeconds(0.5f); text3.gameObject.SetActive(false); text2.gameObject.SetActive(false); text1.gameObject.SetActive(false); textGo.gameObject.SetActive(true); yield return new WaitForSeconds(0.5f); async.allowSceneActivation = true; yield return async; }

Dictionary serialization does only work with primitive value types

$
0
0
It seems that Photon can only serialize Dictionaries as long as their value type is a C# language primitive: >stream.SendNext(1f); //works >stream.SendNext(new Dictionary {{0, 1f}}); //works >stream.SendNext(Vector3.one); //works >stream.SendNext(new Dictionary {{0, Vector3.one}}); //does not work for the last line, I get: >InvalidDataException: Unexpected - cannot serialize Dictionary with value type: UnityEngine.Vector3 Is this known? If so, are there any ways to get this working? I'm aware I could simply set all primitives of the type separately (in this example: vector3.x, vector3.y, vector3.z), but I'm looking for a clean and standardized solution that I can apply to all my own registered custom data types. Thanks!

How to move player to another room that created room at the same time!

$
0
0
Hello, I'm using joinRandomRoom to connect to existing rooms, the problem is if two people click play at the same time it creates two rooms because there is no time to create one room and the other connect to it! Then I thought about the possibility that when two players click play they can create two rooms at the same time, but one of them leaves the room and connects to another that there is vacant space! How can I do this?

Is Warthunder/ Apex like multiplayer system with PUN and Photon Servers possible?

$
0
0
Hi, I am currently developing a game where you just click on its a button and it would matchmake with every joining players' level and put them into a 4v4 match. And i dont want any of the players to be a master client. Any way i can do that with PUN 2 and also use the hosting services Photon provides to host the game ? Thanks in advance :)

Variables within PunRPC do not work on Unity!

$
0
0
Variables within PunRPC do not work on Unity! pv.RPC("call", RpcTarget.Others); [PunRPC] void call(){ iscalled = true;}

How to "double instantiate" an object and have all players receive reference to that

$
0
0
Basically, what I want is that when one player instantiates an object (PhotonNetwork.Instantiate), all other clients should spawn an extra object which should persist to all users, and each user should have a reference to which object caused this new object to spawn. For example, if there are 4 players, player one spawns an object. When players 2,3,4 see that a new object is spawned, they spawn an object on their own so now the scene has a total of 4 objects. This is easy to do, but I dont know how I can save a reference to them. e.g Dictionary > where OtherSpawns are the other objects instantiated due to this object

Player destroyed when loading a new scene

$
0
0
Hello Guys, So what I am trying to do is when 2 players joined a room than I am loading a new scene called Gameplay and but in Gameplay scene player clones gets destroyed. So do I have to spawn players again in Gameplay?

Rigid body networking of a non player controlled ball

$
0
0
Hi all. I need some advice.
I have a prototype of a pong / rocket league type game. Basically 2 players control their balls to hit another ball into the opponents goal.

It uses the unity rigid body component and is very fast paced.

1) could someone point me to a good example of how to handle fast paced physics objects syncing (player controlled).

2) are there any good resources on networking non player controlled physics objects?

Thanks for any advice :)
Martin

FixedBehaviorUpdate PhotonHandler.FixedUpdate Lag Spikes

$
0
0
As you can see I keep having these horrible lag spikes in game, I'm not sure what causes them or where to look specifically. It's during regular play in a room with other players, it doesn't occur outside of the rooms, only when in game with other players.

Help with syncing parent

$
0
0
I need helping with syncing the object to its parent. I first create it using PhotonNetwork.Instantiate and assign its parent using transform.SetParent. This works but when a new player join, for that player the object isn't parented and is just sitting in the middle. Anyone know how I can sync the object to its parent even for new player.
Viewing all 8947 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>