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

TransferOwnership not working

$
0
0
Hi, I'm trying to use transferownership when a new object has been instantiated over the network. I see the message: TransferOwnership() view 1020 to: 1001 Time: 609 and then: Ev OwnershipTransfer. ViewID 1020 to: 1001 Time: 890 but if I select the object, the owner is still scene, instead of player 1. I call this code immediately after the object is spawned using photonnetwork.instantiate and it is run after both players have been created. This is in a gameplay scene that is loaded once both players join the room in the lobby scene, so I assume that both players are already in the room by the time this code runs. -JJ

Problem with joining same room

$
0
0
I've been making changes in my app (unrelated to joining an existing room) and when I try to join two players to a room they seem to be getting sent to different rooms? I'm hard coding the room name when creating/joining the room so I'm not sure what's going on here. I rebuilt the project to a previous Unity collab that I knew didn't have this problem but after switching I'm getting the same situation.

RPC Or Set Custom Room Properties

$
0
0
Hello, I would like to update my turn timer in which I want all players in room to see. Based on some reading, should I use an RPC or should I set the room properties? Thanks, jrDev

Tutorial example players never join the same rooms

$
0
0
Hi, An absolute beginner here. I came to part 4 of the tutorial (https://doc.photonengine.com/en-us/pun/v2/demos-and-tutorials/pun-basics-tutorial/gamemanager-levels) and running a built game as instructed alongside the Unity Editor one. The problem I have is that PUN just continues creating new rooms and players are never matched. I have no idea on even how to debug this thing. I was actually warned of a friends to avoid PUN 2 as he was in the same problem with the tutorial and I just shrugged it as some misstep he took.

"Invalid Cast" On Deserializing PhotonTransformView last Photon 2.14

$
0
0
I am getting the following error since updating to the last version 2.14 https://forum.unity.com/attachments/upload_2019-8-27_21-13-52-png.474512/ InvalidCastException: Specified cast is not valid at PhotonTransformView.cs: 93 I tried debugging since it seems it is receiving some strange data from whoever is controlling the object in question, and debugging the stream.ReceiveNext(); that is supposed to set this.m_Direction, I saw a Vector4 instead of a vector3 which is what causes the invalid cast and freaks out about it. I am not sure why this is happening though. I also changed my transformviews to the tranformviewclassic ones and I get the same error, this time it is localized to the rotation (OnPhotonSerializeView of the m_RotationControl), I get a cast invalid to a quaternion and if I debug it i see that is is because I am getting a Vector3 (0,0,0) from the stream instead of a quaternion. The photonviews are unreliable on change,and it happens only at the beginning of starting the change, in case that helps.

[PUN2] Best Region: investigation and improvements

$
0
0
Hi, We have been getting various reports about clients (Unity Editor or build) unexpectedly not connecting to the same region when "Best Region" is used. By "unexpectedly", I meant clients in the same geographical area, connected to the same network or even running on the same machine. We started addressing this issue on documentation, see "Best Region Considerations". However, we think that this is not enough and we want to improve the heuristics we use to determine the "Best Region". But in order to do this, we need your help. We need you to provide us with some logging entries which will help us investigate and decide what to do next. To know which region you are connected to, one way is to log it in OnConnectedToMaster callback, something like this:
        public void OnConnectedToMaster ()
	{
              Debug.LogFormat("PUN2 client connected to region: {0}", PhotonNetwork.CloudRegion);
	}
First of all, you need to update to latest PUN2. Logging instructions: The region pinging results can be logged very easily: In the PhotonServerSettings, set the "PUN Logging" level to Informational at least. For the editor, you can force the "Best Region" pinging. Use the "Reset" button in the PhotonServerSettings to clear the "Best Region Preference". Via code, you can also clear the setting: PhotonNetwork.PhotonServerSettings.ResetBestRegionCodeInPreferences(); Log entries needed: Two log entries are of interest: "PUN got region list. [...]" and "Region Pinging Result [...]" which contains multiple lines. We need those from the clients that have different opinions of which region to choose. You can copy them directly from Unity Editor Console window or from Editor log or build log file (log files). When you manage to reproduce the issue of two PUN2 clients, geographically located next to each other or connected to the same network or running on the same machine but were connected to different regions using "Best Region" (default), get the logs mentioned above using the instructions explained above as well. You can copy those and send them to us via developer@photonengine.com, preferably use the same subject as this discussion: "[PUN2] Best Region: investigation and improvements". Do not forget to send us PUN2 version, Unity version and other details about the report that you could consider useful (if clients are connected to the same network, Unity Editor or build, which device, which OS, running on the same machine or not, etc.). We appreciate your efforts and all your help. Thank you for your time and understanding. NOTE: PUN Classic is in maintenance or feature freeze mode. So we will focus on PUN2 only.

Lost Photon connection between Unity and Unity build exe

$
0
0
Hello, I've created a Lobby system for creating and joining rooms and my problem is that Unity suddenly can't communicate with its build executable thought Photon (can't see created rooms), only builds can communicate with each other. And that's not all, it was working normally on my laptop, but didn't on my desktop computer, and now it doesn't work on the laptop either. Does someone know what is happening please?

Cannot join existing rooms (PUN2)

$
0
0
Hi everyone, Whenever I create a room another player cannot join it. I have overrided the function OnJoinRoomFailed to Debug an error if the room cannot be joined. Lets say on one client I create a room called "TEST", on a different client if I do PhotonNetwork.JoinRoom("TEST") it will give me an error and call OnJoinRoomFailed. Also, my server browser is no longer working all of a sudden. I was working on my project last night at around midnight and woke up to find that I cannot join any rooms and my server browser is not working. Is this a Photon issue? Thanks!

Cross Platform Connecting Demo

$
0
0
I built the Asteroids demo for Android and PC just to see if it worked. They do not see each others' rooms. What do I need to do to have them be able to be in the same room?

How to test game on one pc

$
0
0
Hi there, how can i test my networked game on one pc? When I build a version and run a second instance in the editor i can't connect to the same room? Both instances create a new room. Any advice? Greets

Unable to join the same room it seems?

$
0
0
So I followed a tutorial on using PUN, and got it working great. I then took that tutorial and imported it into a preexisting game, added pun and ran it. The SAME code in the preexisting game is not throwing errors, but when I join the same room with two clients, I can not see the player that is spawned. Is there some setting, or some incompatibility that could be causing this? I am pretty stumped currently.

Can't find other rooms in PUN 2

$
0
0
Hello, I ran into this bug a couple days ago. I'm not really sure what's going on. After I've connected, I create a room on Computer A. Then on Computer B, I connect, and take a look at the room list - no room appears. When I "Join Random Room" on Computer B, it just ends up creating its own room. Neither client seems to be able to see any of the created rooms. I haven't made any chances to the network code recently, the bug just suddenly appeared while I was testing. It also seems to appear in the PUN demo examples. Any idea what's going on?

Photon is connecting to different servers

$
0
0
I am connecting to photon using ConnectUsingSettings(). In the Unity inspector I have no server address specified. I was not able to see rooms in some clients. After much investigation I discovered that some of my clients are connecting to a different server address and thus not able to see or join games. What might be causing this to happen?

Parenting To GameObject

$
0
0
Hello, When I spawn a new player, I have the Gameobject be parented to the GameManager and renamed. So I am testing this in the Editor Play mode and a build Player, and whenever a player is spawned only the editor player is parented and renamed. The build player just has the spawned objects name and not in a hierarchy as I wanted. Is there anything else I need to do? Thanks, jrDev

Reliable delta compressed is strange

$
0
0
I'm developing a fps game for about 2 months, the game is completed, the last thing to implement is the multiplayer. I've been trying for 1 month but I found a problem. to what I know the item observe option, if set to reliable delta compressed it should send the packets every time they are different from the previous ones, for this I have set reliable delta compressed in 15 objects that will synchronize an int variable that will be modified maximum 10 times per object . I also know that unreliable on change and unreliable send packets either per frame or 15 times per second, so I set unreliable on change just for the position of the characters and bullets. the problem is that disabling the 15 objects with reliable delta compressed the game works, or at least the characters are seen each other and the position of both is synchronized correctly, while if you enable the 15 objects the game does not work anymore, from a character sees the position of the other but the second does not even see that the first appeared. and yet it should be indifferent since the network is not overloaded because the data of the 15 objects with reliable delta compressed are loaded a few times. does anyone know why and how to solve it? Thanks in advance.

How many clients can one Photon Master deal with in a very short time?

$
0
0
Hi @JohnTube Maybe a hard to answer question, For example, in one minute. Our self hosted server's hardware configuration: CPU @Intel@Xeon 2.5GHz Memory 2GB Network Max bandwidth 100Mbit/s. Thanks. Harlan.

Synchronized Parameter Warning - Code Fix

$
0
0
Hi all, We're experimenting with Photon and encountered this log: Parameter 'X' doesn't exist anymore. Removing it from the list of synchronized parameters. Unfortunately, the automatic removal of those properties doesn't mark the object as dirty, so it will happen every time you interact with the object. The fix is to add into PhotonAnimatorViewEditor, line 177 (after the paramsToRemove check and before the foreach): Undo.RecordObject(m_Target, "Auto-Remove params"); Hopefully helps someone, and gets rolled back into Photon! Gareth

PRC call error,when the two same components in a gameobject

$
0
0
I have a component called shooter. And I have multi shooter components on my player game object. If I use PRC call shoot function of a shooter. It will cause an error, "NullReferenceException: Object reference not set to an instance of an object" I think it caused by multi shoot function in the same gameobject, but I need many shooters in my player gameobject so I can stack many shooting ways up. How can I tackle this issue?

Master Client stops sending/sync and Disconnect after a few Levels

$
0
0
Hi, I am creating a 2D Multiplayer game using photon cloud as server. My game has 2 players one of them is master Client. After playing few levels of the game. Master Client stops sync and I can see infinite exceptions on Master Client before it disconnects.

Disconnection on object spawn by stream

$
0
0
Hi, I'm actually working on a collaborative mode for a scene editor software. I stream all the object that are created but on the end of the spawn, the user who creates the object is disconnected. I think it's because there is too much CMD into my RPC but, this feature that manage the spawn of my object was working 2 weeks ago without any problem, so i got back at the commit when it was working but unfortunatly it is not working anymore. I try to reinstall my photon server, but nothing appends. Here the logs : I'm blocked, so a bit of help will be appreciate Thank you.
Viewing all 8947 articles
Browse latest View live


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