Jump to content
This site uses cookies! Learn More

This site uses cookies!

armedunity.com uses cookies to improve user experience.

By continuing to use this site, you agree to allow us to store cookies on your computer.

  • 0
blueagardq13

Photon FPS multiplayer Help!!!

Question

Ok i have a problem when i create a room its all good but when someone else joins the room then thats when i could see his camera and we controll eachother. its been getting on my nerves. Also my mouselook script is attached to my player prefab.

 

 

Here is a video of my Problem: Please login or register to see this link.

Edited by blueagardq13

Share this post


Link to post
Share on other sites

24 answers to this question

Recommended Posts


  • 0

all you have to do:

Please login or register to see this code.

if it's still not working, show us screenshots or even video.

Share this post


Link to post
Share on other sites
  • 0

And you think that i can help you after seeing this video? you should show me what you have in editor (in Inspector window) - basically what's on your player.

And in which script you check if photonView is yours and how you try to disable cameras and scripts.

Actually in editor you can see which scripts and cameras are disabled, so you can easily find out where is problem.

Share this post


Link to post
Share on other sites
  • 0

as i understand you have 3 cameras (2 on player and one more in scene).
*when you instantiate player - disable scene camera.
*use one script to disable all stuff on remote player (i mean one script which is attached on root GO of player - where you have photon view).

class RemotePlayer extends Photon.MonoBehaviour{

var go : GameObject; //if both cameras are under GO "Soldier"  attach Soldier here.

 

function Start(){
if(!photonView.isMine){
go.SetActive(false);

//disable all scripts on player

//destroy character controller

}
}

}

what you use for sync? OnSerializeNetworkView()?

Share this post


Link to post
Share on other sites
  • 0
Please login or register to see this quote.

 

I mean position, rotation of player.

OnSerializeNetworkView() inside script "ShowHideCursor"? Then, don't disable this script. Use ReliableDeltaCompressed.

Also i saw errors - i think you should fix them.

Share this post


Link to post
Share on other sites
  • 0

I think you should watch some tutorials and read Marco Polo Tutorial. You are not ready to make multiplayer game. If you are not understand how it works, you are wasting your time.

Share this post


Link to post
Share on other sites
  • 0
Please login or register to see this quote.

 

Lol photon doc says to save bandwith we should use UnreliableOnChange

Share this post


Link to post
Share on other sites
  • 0

I didn't read docs, but as i know Unreliable makes much more bandwidth. Show me where they suggest to use Unreliable.

Share this post


Link to post
Share on other sites
  • 0
Please login or register to see this quote.

 

It was this site , I think, but it's down right now

Please login or register to see this link.

Share this post


Link to post
Share on other sites
  • 0
Please login or register to see this quote.

 

Now that its up again, it wasn't this site. They dont even talk about optimisation or im too dumb to find it

Share this post


Link to post
Share on other sites
  • 0

When you deal with Photon cloud you should think about optimization because more messages you sent, less players can play. At least in photon forum one of team members wrote something like that.
So i don't think that they will suggest to use Unreliable.
Unreliable - sends messages even when you don't perform any action.

DeltaCompressed only when there was some changes.

Share this post


Link to post
Share on other sites
  • 0
Please login or register to see this quote.

 

And what is UnreliableOnChange then for ? I dont see any traffic when i dont do anything.

Share this post


Link to post
Share on other sites
  • 0

Found info.
"The biggest change is that we now have a "Unreliable On Change" mode for syncing positions or script-created updates in PhotonViews. It's the default case for new PhotonViews. With it, updates are sent unreliably while the sent data changes. When the logic detects that nothing changed, it sends a final update as reliable and skips further updates until the synced data changes again from update to update. With the final reliable update we make sure all clients get the final state before we drop sending news (which aren't news at all). This is (e.g.) good for objects that sometimes move but also might stop moving."

 

 I'm using a bit older version of PUN.
 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...