This tutorial will not work for Photon Fusion 2.0 which isn't fully released yet (it is in release candidate mode). You can download the 1.1.8 SDK here doc.photonengine.com/fusion/v1/getting-started/sdk-download
seriously thank you so much, Photon makes incredible networking APIs but those geniuses don't know how to make a tutorial to save their life :') I was losing my mind trying to wrap my head around some of this stuff!
I'm new in game programming, all I have done was a lil 2D RPG learning the basics. Not only your tutorial is very clear and really shows how to code with Fusion, but you also explain everything and show great structure things In addition to this, you also hint more stuff we can look for : you said we could communicate to the serv our inputs using bits, so I looked that up and made it ! Thanks a lot ! You sure is a real chad, you're helping people like me getting real solid bases and achieving their dream of following the game dev path.
@@kwanhofu2968 This tutorial will not work for Photon Fusion 2.0 which isn't fully released yet (it is in release candidate mode). You can download the 1.1.8 SDK here doc.photonengine.com/fusion/v1/getting-started/sdk-download
Great tutorial here Pretty Fly Games. Clear and concise, and goes into detail without getting caught up in the weeds. Question: What do you use as a backup/version control solution? Git seems to dislike unity
Glad that you liked it. I use Git and also a plain zip backup for releases. I haven't had any problems with it could potentially be a bit more of a problem if you work in a team with clashing commits etc.
This videos are so helpful thank you! I have one question. How can i teleport my character to other places? I changed the transform but it's not working. Thanks for attention.
Only the host/server can change the position of a transform. If you want to trigger a teleport from a client you need to tell the the host/server that you want to teleport either through Network input or use a RPC call. The host/server then needs to change the position of the transform.
Thanks!! Can you make some video using Navmesh instead charactercontroller? I'm almost finishing my game but now I need to make it multiplayer because I did it singleplayer, can you give me some advice?
The navmesh should only be active on your host. The clients would then have the navmesh disabled and get the updates from the host about the position etc just as if it was a normal player.
Did fusion change again? 1.1.6 doesn't seem to load the DontDestroyOnLoad assets. I have checked and quadruple-checked that I am doing things as you have done but nothing works.
After finishing the spawning objects segment, I run the game and it seems to launch but then it instantly shuts down. There are no errors or warnings, it just says server runner started and server shutdown
What do i do when player object doesnt seem to react to anything at all? The network runner and simulation is working fine, but player spawns and is just stuck in air
You'll need to figure out what is happening and why. You can inspect the network objects in Unity and ensure that they have a input authority and that it matches the player that is supposed to control it. Also verify that the state authority actually has authority over the object using the same method.
Hey thanks so much for creating such a thorough tutorial. When I try to run the completed episode project the editor version works as expected but when I add other clients by building the project they don't seem to join the game. Can you think of any reason why this might be the case?
I've used my own Fusion app key and the error I get in the client Development Console is: DllNotFoundException: nanosockets assembly: type: member:(null)
Thanks for the video it's very helpful. But I have a problem when when I let the first player in, the camera is pointing right at the first player. But when the second player appears, the first player's camera is pointed at the second player, and the second player's camera is fine (still pointing at the second player). Do you have any solution?
@@PrettyFlyGames I really don't know. I just learn Unity recently. Perhaps you can tell me which types of projects photon fusion and network coding are suitable for each. very appreciate that.
@@RocketManEqHuoJian5 if you have learnt Unity recently then I'd focus on making a couple of simple single player games first. Multiplayer is 10x more complex than making a single player game and it helps a lot to gain experience from the offline first. In general I'd say that you can use Photon Fusion & Netcode in similar scenarios: FPS games & games with fast moving parts. If you are looking at making a larger scale game then both of them will require servers which makes things complex fast. Another option is Quantum which doesn't need a server and is suitable for MOBA, top down style games, racing games etc. Which one to chose from is really up to your taste. Personally I'd probably go with either Quantum or Photon Fusion over Netcode.
Is there a project that has the same exact things you start with? The linked project already has all the source filled out. I guess I can just delete as we create the files, but just curious. Thanks!
Hey Bro please help, something is going wrong in if (runner.IsServer) { Debug.Log("OnplayerJoined we are server. Spawning player"); runner.Spawn(playerprefab, Utils.GetRandomSpawnPoint(), Quaternion.identity, player); } There is a red line under Spawn it says: Assets\Scripts\Spawner.cs(21,20): error CS0311: The type 'NetworkPlayer' cannot be used as type parameter 'T' in the generic type or method 'NetworkRunner.Spawn(T, Vector3?, Quaternion?, PlayerRef?, NetworkRunner.OnBeforeSpawned, NetworkObjectPredictionKey?, bool)'. There is no implicit reference conversion from 'NetworkPlayer' to 'Fusion.SimulationBehaviour'. please help
Based on just that code I can't really tell what could cause that. Did you try the provided sample and compare it with your code? www.patreon.com/posts/multiplayer-fps-65725126
i have very laggy character movement. is there any way to fix this? it seems like the character is jumping between the old and new position while walking. Could you please provide some help?
Make sure that you complete this video first ruclips.net/video/ndL1siRSBg8/видео.html and then hopefully it will be better. You can also turn on client side prediction which will help the local client reduce lag.
@PrettyFlyGames I followed your tutorial up to the spawn part. When I hit play, the runner connects to the server but then it shuts down after maybe 5 seconds and it never spawns my player in the game. The DontDestroyOnLoad asset pops up and disapears quickly too. What do you think is the issue?
Just wanted to let you know as of build 590 "Implicit cast of PlayerRef to bool is now marked as obsolete, will be removed in next stable release", so soon you will have to change your code for the Network player in the PlayerLeft function. If you know what the better code would be then let me know.
That error message is caused because the VS thinks you are trying the use Unitys own NetworkPlayer. Did you add using Fusion at the top of the script? Also try the sample project and compare your code with that www.patreon.com/posts/multiplayer-fps-65725126
At 6:41 i get the error: Assets\Scripts\Network\NetworkRunnerHandler.cs(23,110): error CS1503: Argument 4: cannot convert from 'int' to 'Fusion.SceneRef' Please could you help fix this?
I also get another one saying: Assets\Scripts\Network\NetworkRunnerHandler.cs(45,13): error CS0117: 'StartGameArgs' does not contain a definition for 'Initialized'
Hey there! I've been working on a new episode covering this. The code is just done for the episode but the video is not recorded yet, it will take a few days. If you can't wait until then you can get Early Access to the code: www.patreon.com/posts/87190812
Hello! I'm following your video to make my first FPS game. However, I keep getting an error telling me that the NetworkPlayer is obsolete. Is there any alternatives to this? Or any solution?
Hello! That is probably due to a typo in your code. Make sure that you have using Fusion; in the top of your code when ever you are going to use NetworkPlayer . You can download the example project here: www.patreon.com/posts/multiplayer-fps-65725126
It is because this tutorial is for Photon Fusion 1.x and things are slightly different in Photon Fusion 2.x. Have a look at this upgrade video ruclips.net/video/RQWyVaEjC3Q/видео.html
I'm using a ready-made character pack. How does this integrate with Fusion? There is no information about this in the documentation. Previously, is Mine control was provided with Pun2.
How to add ready made models are covered a bit later in the series ruclips.net/video/7TWOeszsTUw/видео.html In Photon Fusion you use Object.HasInputAuthority instead of IsMine.
Hi, in the part where i use the GetInput function it says this The type 'NetworkInputData' must be valid unmanaged type (simple numeric, 'bool', 'char', 'void', enumeration type or struct type with all fields of unmanaged types at any level of nesting) in order to use it as a type argument for 'T' parameter I'm not using the character controller prototype, because I'm making a 2d game, is that the problem?
After and before installing the Mono Cecil package I get an error. The error is "Plugin Mismatch requested = 'FusionPlugin' got= 'Default' (ErrorCode :32751) " Any idea on what is causing this? The Network runner starts. But then is destroyed instead of going to DontDestroyOnLoad.
You need to use a AppId which is a Photon Fusion AppId. So make sure that you create the correct AppId on the Photon Dashboard. Most likely you are trying to use a PUN or something else appID.
@@alinazhuang904 I've only tried AWS and Azure for some tiny projects and both of them works well but I haven't spent enough time with either to really make any recommendations.
@@PrettyFlyGames thanks, would you also consider to combine the tutorial with AWS? I tried playFab but there is no game server region around Asia. So I might have to use AWS
@@PrettyFlyGames @Pretty Fly Games no, like we have for Unity in visual studio extensions. so if we type the starting of a function it can suggest the function you are looking for! I am reffering to the (protected virtual Task InitializedNetworkRunner(NetworkRunner runner, GameMode gameMode, NetAddress address,SceneRef scene,Action initialized)) fuction as we have to type everything itself! just asking if there is anything like it?
@@FakeDani69 ahh I'm not sure. IntelliSense sees to be working pretty well for me but you might want to reach out to the Photon Team and check with them.
I want to save the player registration information and various data such as prop information to the database, how can I do it?(Develop multiplayer games with fusion)
This tutorial series is for beginners and databases is a bit to much to cover. The question is also very generic but you can save any data you like from Photon Fusion to a database or a file.
@@PrettyFlyGames Thank you, I haven't had time to study your tutorials yet, I plan to take some time to study your tutorials seriously in the near future, I am a beginner of "fusion", and I have only studied the basic function teaching given by the official. Thank you in advance for taking a tutorial for this!!!
Getting a strange issue where the spawn point vector3 (GetRandomSpawnPoint) is always doubled - Checking the numbers with Debug log and (-18,1,14) is spawning at (-36,2,28) Any ideas?
Is tthe value from GetRandomSpawnPoint doubled meaning you log the value right after you get it or is the character spawned at another location? If the problem is with that the character is being respawned in a different location then that is addressed in later videos. The respawn code was improved. If the problem is that the Utils.GetRandomSpawnPoint returns 2x what you expect then it is something in the function that is causing it.
@@leehobbs4778 right! So I think that this is caused by the spawn code itself and it is improved in a later video ruclips.net/video/gxhG9BHcxmc/видео.html Let me know if that fixes it.
Haha, yeah it can feel that way sometimes. Just take it bit by bit and don't stress. Eventually it will feel better but weird shit will always happen in multiplayer 😁
@@PrettyFlyGames Awesome! Struggling to grasp the implementation for dedicated server in the fusion docs. A thorough tutorial would be fantastic. Is this coming in the near future? Thanks again!
I'm sorry but I have to say that I don't know. I'm quite swamped currently with my own projects and a bunch of requests for features in the current tutorials.
I am at 29 minutes and the chatacter movement handler has a line where GetInput doesnt work, I have tried comparing it and it hasnt worked, not even copy and paste the code helped, do you know the problem?
@PrettyFlyGames Yes it states " The type 'NetworkInputData' must be a non-nullable value type, along with all fields at any level of nesting, in order to use it as parameter 'T' in the generic type or method 'NetworkBehaviour.GetInput(out T)'.
@@NotScaredOf make sure that it is a struct and not a class. You can download the project with code here: www.patreon.com/posts/tutorial-how-to-83543734
It tells me to put the same if () inside of in it and write return; is this a fix? If(getInput(Out NetworkInputData networkInputData) [ If(getInput(Out NetworkInputData networkInputData) [ Return; ]]
@@jamesshu5599 one of the computers becomes the host and the other connects as a client. When you call StartGame the computers connect and if you use the option Autohost then the first computer that connects becomes the host. When the other computers call StartGame they become clients. Photon Fusions handles all the other connection parts for you.
@@PrettyFlyGames thanks I will check, Should we use Navmesh on the network moveable characters but the issue is opponent is not against me in my game play and vice-versa
It is the way that I've selected to teach gamedev. I paste the code and I explain it. I could be typing the code but that would probably take like 2x the amount of time and give little to no benefit.
@@PrettyFlyGames (like im not hating, im sorry if it sounded like that) but i feel like if you copy and paste you should leave the source code or something
@@PrettyFlyGames An error occurs when you assign and play NetworkPlayerPrefab to Spawner, and Prefab is not automatically registered in Fusion - Network ProjectConfig. It seems that the GUID of the NetworkObject prefab is not recognized.
@@lth000 you can try to rebuild the object table. Just go to the top menu and under Fusion select "Rebuild Object Table" if that doesn't solve it I would contact Photon Fusion and ask them about it.
@@PrettyFlyGames I think the current possibility is that the prefab should be in the path where the prefabs of the photon sample project are located..? (Assets/Photon/Fusion/Scripts/Prototyping/Prefabs)
Hey Dude Im having a problem when wirting the "runner.Spawn()" line This is my code: runner.Spawn(playerPrefab, Utils.GetRandomSpawnPoint(), Quaternion.identity, player); "Spawn" is underlined in red implying that it is an error obviously Here is the error: "The type 'NetworkPlayer' cannot be used as type parameter 'T' in the generic type or method 'NetworkRunner.Spawn(T, Vector3?, Quaternion?, PlayerRef?, NetworkRunner.OnBeforeSpawned, NetworkObjectPredictionKey?, bool)'. There is no implicit reference conversion from 'NetworkPlayer' to 'Fusion.SimulationBehaviour'. "
That does sound a bit strange, check the example project and compare it with your code www.patreon.com/posts/multiplayer-fps-65725126 Let me know if that fixes it for you.
This tutorial will not work for Photon Fusion 2.0 which isn't fully released yet (it is in release candidate mode). You can download the 1.1.8 SDK here doc.photonengine.com/fusion/v1/getting-started/sdk-download
seriously thank you so much, Photon makes incredible networking APIs but those geniuses don't know how to make a tutorial to save their life :') I was losing my mind trying to wrap my head around some of this stuff!
Thank you for your kind words and glad that you liked the tutorial.
@@PrettyFlyGames agreed with him. youre tutorials are the best!
@@Jicefrost Thanks 🙏
Their documentation is terrible. I believe they will help enterprises or something.
I'm new in game programming, all I have done was a lil 2D RPG learning the basics.
Not only your tutorial is very clear and really shows how to code with Fusion, but you also explain everything and show great structure things
In addition to this, you also hint more stuff we can look for : you said we could communicate to the serv our inputs using bits, so I looked that up and made it !
Thanks a lot !
You sure is a real chad, you're helping people like me getting real solid bases and achieving their dream of following the game dev path.
Thanks a bunch 🙏
Man this series so helpful this is what i have been looking for! Love you
Glad to hear it 😍
now is photon 2.0.....I tried to type exact same thing but it wont work anymore,,,what should i do x.x@@PrettyFlyGames
@@kwanhofu2968 This tutorial will not work for Photon Fusion 2.0 which isn't fully released yet (it is in release candidate mode). You can download the 1.1.8 SDK here doc.photonengine.com/fusion/v1/getting-started/sdk-download
Probably the best tutorial for fusion and from scratch setup out there. thank you
Thanks you for watching :)
THANK YOU! I can finally learn photon fusion :)
Happy to help!
excellent tutorial, thank you for making this, it's exactly what I needed.
You're very welcome!
thanks for the nice tuts. Please make more !
Thanks! Yes, working on several additional ones.
Great tutorial here Pretty Fly Games. Clear and concise, and goes into detail without getting caught up in the weeds.
Question: What do you use as a backup/version control solution? Git seems to dislike unity
Glad that you liked it. I use Git and also a plain zip backup for releases. I haven't had any problems with it could potentially be a bit more of a problem if you work in a team with clashing commits etc.
just use plastic
Very cool video
Glad you enjoyed it
Nice video
Thanks 🙏
Completed* Thank you
Awesome!
thank you :)). It's useful.
You're welcome!
My beloved, can I use this tuto and simply adapt to a third person instead first person?
Yes, that is possible as many of the concepts will remain the same regardless of the camera mode.
Thanks for the tutorial! I have a quastion: Why are using the old Input System and not the new one ?
I personally like the old system more and in my own game projects I use Rewired which is similar to the old system.
Can you make a chat? I wanna add it, but I dont want to combine tutorials and mess it up.
Thanks for the suggestion 👍 I'll add it to the request list
Thank u so much PreTTy Fly Games
You are welcome!
thank you!
You're welcome!
just starting ... what unity template did you use ? thanks
URP (Universal Render Pipeline)
This videos are so helpful thank you!
I have one question. How can i teleport my character to other places? I changed the transform but it's not working.
Thanks for attention.
Only the host/server can change the position of a transform. If you want to trigger a teleport from a client you need to tell the the host/server that you want to teleport either through Network input or use a RPC call. The host/server then needs to change the position of the transform.
Thanks!! Can you make some video using Navmesh instead charactercontroller? I'm almost finishing my game but now I need to make it multiplayer because I did it singleplayer, can you give me some advice?
I managed to implement the navmesh with click to move but I just can move with the host, do you know how can I fix it?
The navmesh should only be active on your host. The clients would then have the navmesh disabled and get the updates from the host about the position etc just as if it was a normal player.
yo, that's good
Glad that you liked it :)
How to switch from multiplayer scene gameplay to other scene (simple + additive loading). please make video for this.
Scene switching is covered here ruclips.net/video/3GBl1FDkC6g/видео.html
Did fusion change again? 1.1.6 doesn't seem to load the DontDestroyOnLoad assets. I have checked and quadruple-checked that I am doing things as you have done but nothing works.
Seems to work just fine for me. You can try the code from this episode which uses DonDestroy assets ruclips.net/video/3GBl1FDkC6g/видео.html
After finishing the spawning objects segment, I run the game and it seems to launch but then it instantly shuts down. There are no errors or warnings, it just says server runner started and server shutdown
Did you add your appID and are you using Photon Fusion 1.x? doc.photonengine.com/fusion/v1/getting-started/sdk-download
Yes I did, that fixed it. Thank you so much!@@PrettyFlyGames
@@impartialphoenix261 Great!
What do i do when player object doesnt seem to react to anything at all? The network runner and simulation is working fine, but player spawns and is just stuck in air
You'll need to figure out what is happening and why. You can inspect the network objects in Unity and ensure that they have a input authority and that it matches the player that is supposed to control it. Also verify that the state authority actually has authority over the object using the same method.
Hey thanks so much for creating such a thorough tutorial. When I try to run the completed episode project the editor version works as expected but when I add other clients by building the project they don't seem to join the game. Can you think of any reason why this might be the case?
I've used my own Fusion app key and the error I get in the client Development Console is: DllNotFoundException: nanosockets assembly: type: member:(null)
What OS are you running? Mac?
@@PrettyFlyGames yes I’m on Mac
Thanks for the video it's very helpful. But I have a problem when when I let the first player in, the camera is pointing right at the first player. But when the second player appears, the first player's camera is pointed at the second player, and the second player's camera is fine (still pointing at the second player). Do you have any solution?
Hi!
Yes, that is expected after the first video. Keep watching the series and that problem will go away :D
ruclips.net/video/ndL1siRSBg8/видео.html
Friend, I wanna know which one is better? Photon fusion or Netcode? cus I need to choose one to learn deeply. thanks
Really depends on your project and needs. What kind of game are you making?
@@PrettyFlyGames I really don't know. I just learn Unity recently. Perhaps you can tell me which types of projects photon fusion and network coding are suitable for each. very appreciate that.
@@RocketManEqHuoJian5 if you have learnt Unity recently then I'd focus on making a couple of simple single player games first. Multiplayer is 10x more complex than making a single player game and it helps a lot to gain experience from the offline first.
In general I'd say that you can use Photon Fusion & Netcode in similar scenarios: FPS games & games with fast moving parts. If you are looking at making a larger scale game then both of them will require servers which makes things complex fast.
Another option is Quantum which doesn't need a server and is suitable for MOBA, top down style games, racing games etc.
Which one to chose from is really up to your taste. Personally I'd probably go with either Quantum or Photon Fusion over Netcode.
@@PrettyFlyGames very appreciate for your kindness sharing, I think I got it. you deserve a big thumb, really.
@@RocketManEqHuoJian5 Thank you so much 🙏
Is there a project that has the same exact things you start with? The linked project already has all the source filled out. I guess I can just delete as we create the files, but just curious. Thanks!
No, sorry there is only the ones with scripts. So you'll have to use your workaround, delete em all 💪
On version 1.1.7 the networkRunner is built-in to the basicSpawner
The BasicSpawner is just a sample code in their getting started, right?
Hey Bro please help, something is going wrong in
if (runner.IsServer)
{
Debug.Log("OnplayerJoined we are server. Spawning player");
runner.Spawn(playerprefab, Utils.GetRandomSpawnPoint(), Quaternion.identity, player);
}
There is a red line under Spawn
it says:
Assets\Scripts\Spawner.cs(21,20): error CS0311: The type 'NetworkPlayer' cannot be used as type parameter 'T' in the generic type or method 'NetworkRunner.Spawn(T, Vector3?, Quaternion?, PlayerRef?, NetworkRunner.OnBeforeSpawned, NetworkObjectPredictionKey?, bool)'. There is no implicit reference conversion from 'NetworkPlayer' to 'Fusion.SimulationBehaviour'.
please help
Based on just that code I can't really tell what could cause that. Did you try the provided sample and compare it with your code? www.patreon.com/posts/multiplayer-fps-65725126
@@PrettyFlyGames Thanks for you reply! I find out if you didn't write the NetworkPlayer script then your runner.Spawn will be error!
i have very laggy character movement. is there any way to fix this? it seems like the character is jumping between the old and new position while walking.
Could you please provide some help?
Make sure that you complete this video first ruclips.net/video/ndL1siRSBg8/видео.html and then hopefully it will be better. You can also turn on client side prediction which will help the local client reduce lag.
@PrettyFlyGames I followed your tutorial up to the spawn part. When I hit play, the runner connects to the server but then it shuts down after maybe 5 seconds and it never spawns my player in the game. The DontDestroyOnLoad asset pops up and disapears quickly too. What do you think is the issue?
Hard to tell, look at the logs and see what kind of error message was returned when the runner shutsdown.
Not receiving the OnPlayerJoined callback after implementing the interface INetworkRunnerCallbacks. Can somebody point out what the problem might be?
Place that script on the same object as your Network runner and it should work.
pls can i use this tutorial for a third person game, if yes from which episode is this tutorial relevant
I'll add it to the request list.
Just wanted to let you know as of build 590 "Implicit cast of PlayerRef to bool is now marked as obsolete, will be removed in next stable release", so soon you will have to change your code for the Network player in the PlayerLeft function. If you know what the better code would be then let me know.
Thanks! I'll have a look into what changes are required.
Hello, I wanted to know if it was not necessary to add the NetworkTransform component to the character
It is not necessary since we're using the networked character controller for that instead.
on 34:40 on my unity, NetworkPlayer has been deprecated and removed by unity.
Has any altenative?
That error message is caused because the VS thinks you are trying the use Unitys own NetworkPlayer. Did you add using Fusion at the top of the script?
Also try the sample project and compare your code with that www.patreon.com/posts/multiplayer-fps-65725126
I dont have the weaver error. did i do anything wrong? unity version 2021.3.17f1
Be happy 😃 They have probably fixed this by now.
At 6:41 i get the error:
Assets\Scripts\Network\NetworkRunnerHandler.cs(23,110): error CS1503: Argument 4: cannot convert from 'int' to 'Fusion.SceneRef'
Please could you help fix this?
I also get another one saying:
Assets\Scripts\Network\NetworkRunnerHandler.cs(45,13): error CS0117: 'StartGameArgs' does not contain a definition for 'Initialized'
Hey. Do you know how you can make it third person. can you provide steps please?
Hey there!
I've been working on a new episode covering this. The code is just done for the episode but the video is not recorded yet, it will take a few days. If you can't wait until then you can get Early Access to the code: www.patreon.com/posts/87190812
Hello! I'm following your video to make my first FPS game. However, I keep getting an error telling me that the NetworkPlayer is obsolete. Is there any alternatives to this? Or any solution?
Hello!
That is probably due to a typo in your code. Make sure that you have using Fusion; in the top of your code when ever you are going to use NetworkPlayer . You can download the example project here: www.patreon.com/posts/multiplayer-fps-65725126
why does start game args not have a option for initalized??
It is because this tutorial is for Photon Fusion 1.x and things are slightly different in Photon Fusion 2.x. Have a look at this upgrade video ruclips.net/video/RQWyVaEjC3Q/видео.html
My player view rotations are hideously slow and jerky in the editor, but work fine on a build. Any Ideas? I'm using 2021.3.12f1. :)
Hi Ron
Yes, that would be expected in EP1. What EP 2 where better camera handling is covered ruclips.net/video/ndL1siRSBg8/видео.html
at 8:50 i didn't get any errors, do I still install the package? or....???/
Nice Video btw
The have probably fixed this now so if you don’t get any errors you can just skip it.
@@education2.098 thanks 🙏
I'm using a ready-made character pack. How does this integrate with Fusion? There is no information about this in the documentation. Previously, is Mine control was provided with Pun2.
How to add ready made models are covered a bit later in the series ruclips.net/video/7TWOeszsTUw/видео.html
In Photon Fusion you use Object.HasInputAuthority instead of IsMine.
@@PrettyFlyGames These are very simple packages, do I have to enter each code one by one for the (STP )PolymingGames package?
@@fundaavc1639 I'm not familiar with that package so it is hard to say. It depends on how they made the models and animations really.
This is the same video as EP1 ruclips.net/video/hqIZCoLHOig/видео.html but with Photon Fusion SDK 1.1 instead.
Hi, in the part where i use the GetInput function it says this
The type 'NetworkInputData' must be valid unmanaged type (simple numeric, 'bool', 'char', 'void', enumeration type or struct type with all fields of unmanaged types at any level of nesting) in order to use it as a type argument for 'T' parameter
I'm not using the character controller prototype, because I'm making a 2d game, is that the problem?
How does your NetworkInputData struct look?
It seems you might have intended to declare 'NetworkInputData' as a struct instead of a class
switched from litenetlib and boii I have so many questions lol
The learning curve is sort of steep but it is worth it 👍
After and before installing the Mono Cecil package I get an error. The error is "Plugin Mismatch requested = 'FusionPlugin' got= 'Default' (ErrorCode :32751) " Any idea on what is causing this? The Network runner starts. But then is destroyed instead of going to DontDestroyOnLoad.
You need to use a AppId which is a Photon Fusion AppId. So make sure that you create the correct AppId on the Photon Dashboard. Most likely you are trying to use a PUN or something else appID.
@@PrettyFlyGames Ya it was that I set it up with App ID from a PUN test I had done long ago. Just changed to Fusion ID and worked. Thanks.
In 1.17 theres no weaving problems, at least for me, so do I skip that part?
You can skip that if you don't have any weaving problems. They've probably fixed this.
Could you make a tutorial about how to run dedicated server with photon fusion on playFab?
Yes, I have plans for a dedicated server tutorial and might be able to combine it with playFab.
@@PrettyFlyGames thanks for your reply! Do you recommend in playfab or AWS gamelift?
@@alinazhuang904 I've only tried AWS and Azure for some tiny projects and both of them works well but I haven't spent enough time with either to really make any recommendations.
@@PrettyFlyGames thanks, would you also consider to combine the tutorial with AWS?
I tried playFab but there is no game server region around Asia. So I might have to use AWS
@@alinazhuang904 we'll see. However AWS isn't really different from other hosting, you get a server and you launch your games server on it.
where did you found Iplayerleft i try to find it on api but there is nothing
I found it in their samples.
In the Network Runner Handler Script(until 8:24), i copied the exact script as you have, but at line 24 and 43 there are still errors
What does the errors say?
@@PrettyFlyGames Nevermind, I just had to rename some things
29:23 I have a problem to "GetInput" word, that wasn't permit return "null". CS8377
i perfectly written script.
plz help me. ㅠㅠ
Oh.. i solved that. thanks for video!
You are welcome and glad that you solved it.
@숙회지 how did u solve it? i am getting the same error T^T
@@protato.O i put in there like that! ------
if(GetInput(out var networkInputData))
Is there any extension for Photon Fusion or will i have to manually type every fuction bymself :( thanks
I'm not sure what you mean? Do you want some solution for Fusion that doesn't require you to code?
@@PrettyFlyGames @Pretty Fly Games no, like we have for Unity in visual studio extensions. so if we type the starting of a function it can suggest the function you are looking for! I am reffering to the (protected virtual Task InitializedNetworkRunner(NetworkRunner runner, GameMode gameMode, NetAddress address,SceneRef scene,Action initialized)) fuction as we have to type everything itself! just asking if there is anything like it?
@@FakeDani69 ahh I'm not sure. IntelliSense sees to be working pretty well for me but you might want to reach out to the Photon Team and check with them.
I want to save the player registration information and various data such as prop information to the database, how can I do it?(Develop multiplayer games with fusion)
This tutorial series is for beginners and databases is a bit to much to cover. The question is also very generic but you can save any data you like from Photon Fusion to a database or a file.
@@PrettyFlyGames Thank you, I haven't had time to study your tutorials yet, I plan to take some time to study your tutorials seriously in the near future, I am a beginner of "fusion", and I have only studied the basic function teaching given by the official. Thank you in advance for taking a tutorial for this!!!
Getting a strange issue where the spawn point vector3 (GetRandomSpawnPoint) is always doubled - Checking the numbers with Debug log and (-18,1,14) is spawning at (-36,2,28)
Any ideas?
Is tthe value from GetRandomSpawnPoint doubled meaning you log the value right after you get it or is the character spawned at another location?
If the problem is with that the character is being respawned in a different location then that is addressed in later videos. The respawn code was improved.
If the problem is that the Utils.GetRandomSpawnPoint returns 2x what you expect then it is something in the function that is causing it.
@@PrettyFlyGames I'm logging the vector after its generated (first numbers) and then checking the spawn location (second numbers) which is different
@@leehobbs4778 right! So I think that this is caused by the spawn code itself and it is improved in a later video ruclips.net/video/gxhG9BHcxmc/видео.html
Let me know if that fixes it.
@@PrettyFlyGames awesome, cheers. I've set the utils function to halve the vector for now, but will keep on. Cheers
After multiplayer I don’t think I have a brain any more
Haha, yeah it can feel that way sometimes. Just take it bit by bit and don't stress. Eventually it will feel better but weird shit will always happen in multiplayer 😁
Hello, my inputs are moving only the host. Is there a fix for this?
You probably have some kind of typo or similar in your code. You can download the example code here: www.patreon.com/posts/multiplayer-fps-65725126
at 10:50 , this bug is fixed i think i dont had it ^^
Awesome!
When I connect to the second character, I am controlling the movement of the first player. What is happening?
That is expected on the first episode. Keep on watching (the fix for the problem is in EP2)
@@PrettyFlyGames Thank you for your response
Will you be showing how to host this game online?
Hello!
You mean like running a server online? My plan currently is to create a smaller game for that which runs in server/client mode only.
@@PrettyFlyGames Awesome! Struggling to grasp the implementation for dedicated server in the fusion docs. A thorough tutorial would be fantastic. Is this coming in the near future? Thanks again!
I'm sorry but I have to say that I don't know. I'm quite swamped currently with my own projects and a bunch of requests for features in the current tutorials.
I am at 29 minutes and the chatacter movement handler has a line where GetInput doesnt work, I have tried comparing it and it hasnt worked, not even copy and paste the code helped, do you know the problem?
What doesn’t work? Does it give any error?
@PrettyFlyGames Yes it states " The type 'NetworkInputData' must be a non-nullable value type, along with all fields at any level of nesting, in order to use it as parameter 'T' in the generic type or method 'NetworkBehaviour.GetInput(out T)'.
@@NotScaredOf make sure that it is a struct and not a class. You can download the project with code here: www.patreon.com/posts/tutorial-how-to-83543734
How so you make it a struct?
It tells me to put the same if () inside of in it and write return; is this a fix?
If(getInput(Out NetworkInputData networkInputData) [
If(getInput(Out NetworkInputData networkInputData) [
Return;
]]
My NetworkRunner doesnt spawn the player prefab. What should I do?
Download the sample project and compare your setup with that www.patreon.com/posts/multiplayer-fps-65725126
i am having the same problem I compared and havent found any difference
not clear how others can join the game build that gets deployed
I'm not sure that I understand your question? Do you mean how others connect to your game or how you host it as a dedicated server?
How do others connect to the game in your tutorial?@@PrettyFlyGames
@@jamesshu5599 one of the computers becomes the host and the other connects as a client. When you call StartGame the computers connect and if you use the option Autohost then the first computer that connects becomes the host. When the other computers call StartGame they become clients. Photon Fusions handles all the other connection parts for you.
have anyone worked on the Photon Fusion dedicated server build?
Yes, I have a whole tutorial series about that ruclips.net/video/a1o3Atye6oA/видео.html
@@PrettyFlyGames thanks I will check,
Should we use Navmesh on the network moveable characters but the issue is opponent is not against me in my game play and vice-versa
@@flutterdev8855 you can use Navmeshes on the AI. However it should just be enabled on the host/server side of the code.
@@PrettyFlyGames Sure, thanks. also here the issue is not able to sync the characters between twosides as I am working on battle royale kind of game.
21:08
I get the same error, but it's not solved in the same way...
Do you mean the error "This object hasn't been baked yet"?
30:43 timestamp
What about it?
5:12 is it -- or ==?
==
You do know that you can download the code from there, right?
www.patreon.com/posts/multiplayer-fps-65725126
so were just gonna watch you copy and paste for 56 minutes?
It is the way that I've selected to teach gamedev. I paste the code and I explain it. I could be typing the code but that would probably take like 2x the amount of time and give little to no benefit.
@@PrettyFlyGames (like im not hating, im sorry if it sounded like that) but i feel like if you copy and paste you should leave the source code or something
@@itsdonix 👍 The source code is available here www.patreon.com/prettyflygames
@@PrettyFlyGames why not just github tho?
hi sir i need ur help sir pleeasee say yes
pleaseee
Sure, join or Discord to get assistance discord.gg/AyYtKXT
@@PrettyFlyGames thanks sir
bro i swear networking just never works for me
Haha, yeah it can feel that way sometimes. Did the tutorial not work for you?
Am I the only one with the [Type:0x000001] System.InvalidOperationException?
Not heard anyone else with that problem. When does it happen?
@@PrettyFlyGames An error occurs when you assign and play NetworkPlayerPrefab to Spawner, and Prefab is not automatically registered in Fusion - Network ProjectConfig. It seems that the GUID of the NetworkObject prefab is not recognized.
@@lth000 you can try to rebuild the object table. Just go to the top menu and under Fusion select "Rebuild Object Table" if that doesn't solve it I would contact Photon Fusion and ask them about it.
@@PrettyFlyGames I've tried it many times already I've asked the Photon team, too!
@@PrettyFlyGames I think the current possibility is that the prefab should be in the path where the prefabs of the photon sample project are located..? (Assets/Photon/Fusion/Scripts/Prototyping/Prefabs)
Hey Dude Im having a problem when wirting the "runner.Spawn()" line
This is my code: runner.Spawn(playerPrefab, Utils.GetRandomSpawnPoint(), Quaternion.identity, player);
"Spawn" is underlined in red implying that it is an error obviously
Here is the error:
"The type 'NetworkPlayer' cannot be used as type parameter 'T' in the generic type or method 'NetworkRunner.Spawn(T, Vector3?, Quaternion?, PlayerRef?, NetworkRunner.OnBeforeSpawned, NetworkObjectPredictionKey?, bool)'. There is no implicit reference conversion from 'NetworkPlayer' to 'Fusion.SimulationBehaviour'. "
That does sound a bit strange, check the example project and compare it with your code www.patreon.com/posts/multiplayer-fps-65725126
Let me know if that fixes it for you.
@@PrettyFlyGames Figured out the problem thanks!
@@sweshi5240 great!
Dude how did you slove it? please tell me🤯