Hi,
Currently I try to implement a live video transmission using the RaiseEvent functionality of PUN and the Photon Cloud. Here is a sample snippet code:
textureToSend.SetPixels(webCamTexture.GetPixels());
var bytes = textureToSend.EncodeToJPG(50);
byte evCode = 0;
RaiseEventOptions raiseEventOptions = new RaiseEventOptions { Receivers = ReceiverGroup.Others };
SendOptions sendOptions = new SendOptions { Reliability = false };
PhotonNetwork.RaiseEvent(evCode, bytes, raiseEventOptions, SendOptions.SendUnreliable);
The encodeToJPG results in a 16kb array in my case. Sending 10-15 frames per second would therefore produce ~200kb of data p/s. Unfortunately, my application always disconnects from the room after sending the first few frames. Is this due to the amount of data? If so, are there any known optimization tweaks?
↧
Live video stream
↧
Too Basic Newbie Question
I am not a true gamer, or I'd know this answer. I wrote a Unity chess game; am trying to adopt PUN to make it multiplayer; and have the Dashboard App IDs set up. But after DAYS of hunting the docs and YouTube tutorials, I can't figure out WHERE to play the game or invite other players, or how to run the game online from any server.
I'm trying to get some simple multiplayer working before I tackle the integration with my main game code, but have no clue what to do after I complete my build. Do I upload it? Does the game or source automatically get pulled by AppID at some point? Do I need to subscribe to yet another service for 'presentation'?
I suspect the URL and region in the PUN component has something to do with it, but the docs aren't spelling it out for me.
Again, I'm sorry as this must be far too basic for anyone to have written about, but seems to be a hole in the documentation for complete dolts like myself. I was hoping there would be an "Exit Games" site where my tests would appear, but nowhere I can find.
↧
↧
RPC From Another Class
Trying to call a RPC from another class. But seems like It doesn't work. How can I fix this?
Turning this:
chambers[i].Bullet.Fire(muzzle);
Into this:
photonView.RPC("chambers[" + i + "].Bullet.Fire", RpcTarget.All, muzzle);
I made a debug log in Fire function and seems like It doesn't even trying to call function.
I have [PunRPC] on Fire function. When I press the button I got a log like this:
Sending RPC "chambers[0].Bullet.Fire" to target: All or player:.
Thanks already.
↧
Client Controls Wrong Character[VR]
I am working on a VR project, using .isMine on character script. When I open first client It seems okay player controls the right character but when second clients join first client starts to control second character. (Can't check the second client situation my other VR just went down). I can't post script due to privacy policy of company. Any help would be nice thanks.
↧
PunBasics-Tutorial error
Hello.
1) I use PunBasics-Tutorial for myself
When I lift the camera to the top I see duplicate names.
How to fix it ?
https://drive.google.com/open?id=1lJ8ZgfFsLuGBYMFLc5dy0rELgTMLsd16
2) How to create a chat for players ?
I did not find examples
↧
↧
Back to the basic 2 - OnConnected and OnConnectedToMaster
Hi
Can someone give me some tips to fully understand the difference between the two?
I get that OnConnectedToMaster happens on the first connection to the master server, OnConnected in all the other cases?
Thanks for you help
Paolo
↧
iOS Build and Unity License
Hi
I made a build for iOS from my original Windows project with Unity Cloud Build, and it compile correct.
After all the setup require by Apple, I was able to instal the application on my IPad.
But when I try to conne it immetidly DisconnectByCLientLogic.
How it works? I read Online that I need the Unity Pro license to build a project with PUN for iOS.
Can you give some clirifacation for this?
Thanks
Paolo
↧
Photon Server Setup Question
I've downloaded and imported Photon Pun V2 to my current project and I'm really liking how it's set up and the interfaces. The documentation has been great up to a certain point. I'm a beginner at C# and am interested in learning, but have run into a special problem with the documentation. At the very end of part 6 - 'Player Camera Work', it says:
"When running in our networked based game, we'll call the public method OnStartFollowing() when we detect that the player is a local player. This will be done in the script "PlayerManager" that is created and explained in the chapter Player Prefab Networking"
("Player Prefab Networking" takes me right to 7 - 'Player Networking')
The script "PlayerManager" isn't mentioned in part 7 - 'Player Networking' until about half-way down the page under the "Camera Control" heading, and it just says:
"Let's modify the PlayerManager script to control the CameraWork component."
It doesn't mention the script anywhere before that. It seems to think that you've already got it created and set up, which I don't, and I'm not totally sure how I'm supposed to use it.
If anyone could point me to a place where it talks about this script or someplace that has it, that would be great! As I said, I am totally willing to learn, but I couldn't get anywhere by researching it.
Thank in advance!
↧
OnDisconnected (ClientTimeout)
Today I'm getting `OnDisconnected (ClientTimeout)` almost all day. I tried to change to the region but it didn't help at all. What could be wrong?
↧
↧
OnPhotonPlayerActivityChanged called Twice.
Hello
In my Case Four Player Of Room and game Is running than player left one by one and last player won.
First time its working fine. But when I matchmaking of those player again and than One Player left so all three player Won because of wrong response in OnPhotonPlayerActivityChanged .In Remaining three player OnPhotonPlayerActivityChanged called Three times and Two times and one times vice versa.
after Left room Is there any unsubscribe event from Punbehaviour or any other thing?
↧
How to use MonoBehaviorPunCallBacks
This may be a pretty trivial issue but I'm trying to implement OnPlayerPropertiesUpdate in one of my C# scripts but its giving me the error ".OnPlayerPropertiesUpdate(Player, Hashtable): no suitable method found to override". My class is already inheriting from MonoBehaviorPunCallBacks so I'm not sure what the problem is. Could anyone inform me how to use a photon method like this? Thanks!
↧
Child objects not showing to other players
Hi,
I'm having a strange issue with my multiplayer game using Photon. I instantiate players in playmode and everything that was/is active on the character prefab upon instantiation, including any child objects is visible to all players, but if I want to activate a child object after instantiation, the child object is invisible to other players and only visible to the character on whom I activated the object.
This is a problem for engine smoke (particle system) and weapons prefab gameobjects that I've attached as children on the characters. Why does this happen and how can I fix it, does anyone know?
↧
ExitGames.Client.Photon.SocketUdpAsync not found
In Unity (2018.4.4) i have no issue but if i build the game i have this error:
MissingMethodException: Constructor on type 'ExitGames.Client.Photon.SocketUdpAsync' not found.
↧
↧
Adjust ServerSettings at runtime?
My game connects to a central update server at startup, and I would like to be able to adjust any necessary Photon settings via this update server. For example, if Photon Cloud goes down I would like to be able to host my own server and temporarily point all my released games to it.
For some reason, Photon's ServerSettings seem to be stored as static members of a nonstatic serialized ScriptableObject. How do I access and change them at runtime? The code I have:
Results in this error:
For some reason, Photon's ServerSettings seem to be stored as static members of a nonstatic serialized ScriptableObject. How do I access and change them at runtime? The code I have:
public static ServerSettings PhotonServerSettings = (ServerSettings)Resources.Load (Path.GetFileNameWithoutExtension (NetworkingPeer.serverSettingsAssetPath), typeof(ServerSettings));
PhotonServerSettings.DefaultMasterPort = 5005;
Results in this error:
error CS0176: Static member `ServerSettings.DefaultMasterPort ' cannot be accessed with an instance reference, qualify it with a type name instead
↧
Non-smooth movement
I've been trying to get players to move smoothly. i tried some smoothing scripts from internet but to no avail... i tried messign around with PhotonTransformView, still jittery.
here is data that i send with SerializeView:
void IPunObservable.OnPhotonSerializeView (PhotonStream stream, PhotonMessageInfo info)
{
if (stream.isWriting) {
stream.SendNext (Health);
stream.SendNext (teamID);
stream.SendNext (transform.position);
stream.SendNext (transform.rotation);
}
else
{
this.Health = (float)stream.ReceiveNext ();
this.teamID = (float)stream.ReceiveNext ();
this.transform.position = (Vector3)stream.ReceiveNext();
this.transform.rotation = (Quaternion)stream.ReceiveNext();
}
}
↧
Check if Client
So in my game, when I finished putting photon views on everything, and when I tested out the game, I could control the two players with the same controls!
In uNET, all I had to do was check "localPlayer" and that would fix everything.
Is there anyway to do this with PUN?
↧
Which should i use for invite friends to same room?
Hey guys , i just implemented pun to my game which called pobqod you can check it in the stores , and i want to make a friend list of players and if they online i can invite them to play with me.So in this case i need a service for keep users online status and make invite call so , what should i use guys?
↧
↧
`PhotonNetwork.Time` doesn't change in every `FixedUpdate`
I noticed that `PhotonNetwork.Time` can be unchanged in several `FixedUpdate` calls in a row. It seems to be odd. Isn't it supposed to be different in each `FixedUpdate` call?
↧
Multiple Unity Projects - Same App ID
Hello, I'm working on a project across two different devices, iPhone and Oculus Quest. The Iphone collects data and sends it across the network to the oculus quest app.
My question is, can this be done in Photon? They're separate projects and share almost nothing between them. (Code wise) I read that sending/receiving of data needed to be handled within the same script and wondered if it would work between two separate apps.
↧
RPC bug ?
Hello, i'm currently using the PUN2 SDK, and when i have a problem with RPCs :
when a try :
aview.RPC("myrpc",aview.Owner);
if the view aview is handled by the current owner, the RPC is not fired.
if the view aview is handled another owner, the RPC is fired.
i think the RPC should be fired even if aview is handled by the current player !
is it a bug, or a normal behaviour ?
↧