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

Can't get instantiation to work

$
0
0
Hey there,

In my scene I have a bunch of Card gameobjects (that all derive from the same prefab, the contents of them have been altered in the editor). Now, I'm using a method called NewDraft to spawn the cards:

public void NewDraft ()
{
Draw = new GameObject[amountOfCardsToDraw];
CurrentDraft = new List();
for (int x = 0; x < amountOfCardsToDraw; x++)
{

LengthOfList = CompleteDeck.Count;
CardType = Random.Range(0, LengthOfList);
GameObject card = GameObject.PhotonNetwork.Instantiate(CompleteDeck[CardType]) as GameObject;
card.transform.SetParent(ParentObject.transform) ;
card.GetComponent().group = ParentObject.GetComponent();
Draw[x] = card;
CompleteDeck.RemoveAt(CardType);
CurrentDraft.Add(card);
}
}

When I try to use the PhotonNetwork.Instantiate I get the error that 'GameObject' does not contain a definition of PhotonNetwork. I'm using the Photon namespace and I've added the Photonview script to the prefab that the cards are created from (so all the cards have it).

Could you help me with this please?

Lots of Crashes on Windows Store

$
0
0
Hello guys i have lots of crashes in windows dashboard. maybe anyone has some thoughts about this

STOWED_EXCEPTION_System.NullReferenceException_80004003_Photon3Unity3D.dll!ExitGames.Client.Photon.SocketUdpNetFxCore.OnConnected

Is it possible to move from a room to another?

$
0
0
I want to make a "base room,' that all players will connect to. Basically so all players can message each other. From there, there will be a button they can click that'll matchmake for them, in which will put them into a new room. Is it possible to put a player into another room from their current room?

I can't connect photonNetwork sometimes.

$
0
0
I can't connect photonNetwork sometimes,but i can after a hours.I don't know it's my problem or the issue of photon server .
It's log in GSGame .
ERROR Photon.Hive.HiveGame.HiveHostGame.Plugin - Failed to create game on http://photon-photon-pluginsdk-v1.webscript.io/GameCreate? : 'Service Unavailable: Back-end server is at capacity' httpcode=503 webstatus=7 response='', HttpQueueResult=5.

Webgl + webhost + photon pun + CORS

$
0
0


Building and running in my local machine works fine, but when runnning from server(000webhost) give me the following error on web console while loading the scene:

No 'Access-Control-Allow-Origin' header is present on the requested resource

for what i searched for it seems i have to add headers in the server response for CORS, but no ideia how i do that, i am c# coder/math and no skills on web

any suggestions to solve this?

Is anything called before a player disconnects?

$
0
0
My weapon pickup / drop system is almost working. Each weapon has a photon view set to takeover, when a player picks up a weapon, that player takes over the weapon's photon view and the weapon is set as a child of the player. When the player dies, all of the weapons they were carrying are separated from the player's game object and the player is destroyed (to allow the weapons to remain in the scene).

This works perfectly when a player dies in-game, as everyone receives the RPC for the player's death. But when the player quits the application, leaves the room, disconnects, the game crashes, etc. The death RPC is never called so the player's game object, along with all of the weapons they were carrying are destroyed. I need the weapons to remain in the scene no matter who connects or disconnects.

What I'm trying to figure out is how to call the death RPC as reliably as possible right before the player leaves the room, are there any other fallbacks I can put in place? OnPhotonPlayerDisconnected, and OnLeftRoom don't seem to be much help as they are called after the player has left the room. Any help would be amazing!

JoinOrCreateRoom only works inside Callbacks

$
0
0
JoinOrCreateRoom only works inside Callbacks OnJoinedLobby or OnConnectedToMaster

Is this intended?

To pre-emptively answer the following:
Are you connected? Yes, I check the PhotonNetwork.getdetailedstate
Are you in a lobby? Yes, default auto join is enabled.
DId you wait a little bit? Yup

Problems when run WSA Windows 8.1 and PUN v1.72

$
0
0
On connect got error:
Connect() to 'ns.exitgames.com' failed: System.InvalidOperationException: A delegate was assigned when not allowed. (Исключение из HRESULT: 0x80000018)
at Windows.Foundation.IAsyncAction.put_Completed(AsyncActionCompletedHandler handler)
at System.WindowsRuntimeSystemExtensions.AsTask(IAsyncAction source, CancellationToken cancellationToken)
at ExitGames.Client.Photon.SocketTcpNetFxCore.Connect()

On other platforms works well

Players cant see other playes who jus joined room at the same time

$
0
0
The problem is if two players try to enter the same room at the same time then one of the player is not getting instanciated. It works if we join room lil late like 5 seconds. Pls help

Update playerName for FindFriends without reconnecting

$
0
0
Is there a way to update he playerName without reconnecting? From what I have seen is that you have to set the playerName before connecting.

My game flow works like this for new players
1. Player starts the game as an anonymous player
2. Player clicks Facebook and it returns his ID
3. Then I set PhotonNetwork.playerName = facebookID

4. Disconnect and reconnect this is the step I want to skip!

5. PlayerName is updated and other people can see the status

User reconnection and lost RPC's

$
0
0
Hi,

We have little problem with user's reconnection. Is it possible to resend RPC's which wasn't acknowledged by server after user reconnect's ? This is an issue when master lost connection during sending some "important" RPC's. Can I somehow execute those RPC's after player reconnects. We are not using RoomOptions.PlayerTtl and ReJoin but I'm trying to do experiments with it.

Thanks



Lan without internet and PUN

$
0
0
Hi, I'm trying to create a local server for some tests, but I'm having some trouble.
I have my PhotonServer installed in a windows pc with a router, and I'm connecting directly to the server. The game connects to the lobby OK, but when we try to create a room we receive this error:

Operation 227 failed in a server-side plugin. Check the configuration in the Dashboard. Message from server-plugin: Failed to create game on http://photon-photon-pluginsdk-v1.webscript.io/GameCreate?

We tried the same thing, but connected our server to the internet and everything worked well, but we need it to run without internet. What do we need to do to make that happen?

Error on new player connected

$
0
0
Hi,
I can't find the reason, why that error appears only in client app when connected to the server. Full error message:

InvalidCastException: Cannot cast from source type to destination type.
Opsive.ThirdPersonController.ControllerHandler.OnPhotonSerializeView (.PhotonStream stream, .PhotonMessageInfo info) (at Assets/Third Person Controller/Scripts/Character/ControllerHandler.cs:287)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
PhotonView.ExecuteComponentOnSerialize (UnityEngine.Component component, .PhotonStream stream, .PhotonMessageInfo info) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonView.cs:525)
PhotonView.DeserializeComponent (UnityEngine.Component component, .PhotonStream stream, .PhotonMessageInfo info) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonView.cs:355)
PhotonView.DeserializeView (.PhotonStream stream, .PhotonMessageInfo info) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonView.cs:340)
NetworkingPeer.OnSerializeRead (System.Object[] data, .PhotonPlayer sender, Int32 networkTime, Int16 correctPrefix) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:3932)
NetworkingPeer.OnEvent (ExitGames.Client.Photon.EventData photonEvent) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:2264)
ExitGames.Client.Photon.PeerBase.DeserializeMessageAndCallback (System.Byte[] inBuff)
ExitGames.Client.Photon.EnetPeer.DispatchIncomingCommands ()
ExitGames.Client.Photon.PhotonPeer.DispatchIncomingCommands ()
PhotonHandler.Update () (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonHandler.cs:125)


I am using PhotonView component with unrelieble observe option and ControllerHandler observer component attached to it. Similar error is received if attach only Photon Animator View. Looks like a problem in syncing with gameObject which is not created yet.
I have found that syncing trouble - master client get that debug log:
master client screenshot
and
client log looks like that:
client screenshot

Any ideas why that can happens? Why photonview start syncing with a object which wasn't created yet?

Problem with PhotonNetwork.autoCleanUpPlayerObjects

$
0
0
** please delete this topic. This problem was not related to PUN **

Why is userId showing the name instead?

$
0
0
Before entering a lobby, i set the player name
PhotonNetwork.player.name = "nickname";

Before I create a room, i make sure publish is true
options.PublishUserId = true;

But when I get the userID of the players, i am getting "nickname" which is the name instead of a guid string for user id...

How can i get the guid instead of the name string?
I need this to save a friend list and nickname isn't reliable as it can contain dupes.

I also don't want to use facebook / google for friends list because not everyone uses it.

IPunPrefabPool Example for Object Pool

$
0
0
Hi ,

I want to pool my effects in my network game.

Can you pleas provide some example how to do it .

What i tried
1. Add PhotonView in Effect and Call PhotonNetwork.Instantiate

And it gets visible in all screens.

How to pool this ?

What i want to do is throw grenade and show effect.


Regards
Unity Learner



customproperties missing on playerconnected

$
0
0
custom properties are missing from photonplayer OnPhotonPlayerConnected!

trying to access a property but it is null! why are properties synced after but not when connection made?

Error Message in Unity5.4: OnLevelWasLoaded was found on PhotonHandler

$
0
0
Hi,

just switched to Unity5.4 (final release) and downloaded the latest Photon PUN Libraries, v 1.73. I still get the warning:
OnLevelWasLoaded was found on PhotonHandler
This message has been deprecated and will be removed in a later version of Unity.
Add a delegate to SceneManager.sceneLoaded instead to get notifications after scene loading has completed

What can I do?

Problems when run WSA Windows 8.1 and PUN v1.72

$
0
0
Hello!

We found a bug in your fresh release under WSA platform.

Clients for all other platforms were updated because of iOS IPv6 support.
Our gamers play from many platforms at the same battle and it’s important for us to have the same version across all platforms.
Currently WSA players stay alone, unupdated and bored :(

Can you please provide any information and ETA on fixing this bug?

Our issue in your forum: http://forum.photonengine.com/discussion/7946/problems-when-run-wsa-windows-8-1-and-pun-v1-72#latest

What does isOwnerActive check?

$
0
0
I looked through the documentation and found nothing about the uses of isOwnerActive. I'm currently using it and it is working as I hoped it would, but it would be nice to have some more information about what it is actually checking when it returns true or false.
Viewing all 8947 articles
Browse latest View live


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