Hey Welton! I finally started using your tutorials! (like 2 weeks ago but ok) Anyway, I wanted to give you some ideas for some other tutorials! Time till a match ends/kills till a match ends, teams (think I saw a comment about that), lag compensation (photon has doc on that but it would be cool if cover it) maybe a better menu. I know is just a simple tutorial to show the basics but just in case you are running out of ideas there's some!
To anybody having trouble out there: I had trouble getting RaiseEvent to trigger OnEvent, found out you need to register each object to get the event handler callback by adding these two functions at the top of your Manager script: public void OnEnable() { PhotonNetwork.AddCallbackTarget(this); } public void OnDisable() { PhotonNetwork.RemoveCallbackTarget(this); }
Hi Bro, I got an Error: ArgumentNullException: Value cannot be null. Parameter name: key(referring to Spawn() and Start() function) I don't know what to do, but I coded everything that you have done in the tutorial. All my UI worked, but after clicking Create (in Create Room) I was not able to play. Another thing was, I was not able to get any room list (Room List) even after I created a Room (there was no button popped up like yours in Room List in tutorial 45). Got any idea how to get rid of this Error? please help me out, Bro.
@@neozoido Hey Hi, go to your Map > Manager(Gameobject), in the Inspector fill the empty Player_perfab_string with your Player prefab's name and drag and drop the Player prefab in Player_prefab. This worked for me!
bro every one of ur videos i was able to understand but this gets over my mind i can copy the code but i cant understand this if someone can give me a link for a deep explaination about this it would be great edit no need now spent alot of time digging everything in it and got a good knowledge now
Just in case someone is adapting this for their own game. Since the ChangeStat functions use byte for their actor and amt variables, you will only be able to send a packet of up to 255 per variable. So you can only update 255 variables to a max value of 255. Meaning, if you have a game where someone has over 255 kills, it will break this script unless the type is updated from a byte to a short or larger. Also, the byte type is unsigned, meaning that you can't send negative values
Also, for funsies, the actor is saved with an int variable which is a signed 32-bit variable, so you can have a minimum of -2,147,483,648 players and a maximum of 2,147,483,647 players in a room.
that's something that there are already tutorials for, you just have to integrate them into this project. It shouldn't be too hard, just tell it to play a sound if the player has died, or if he is walking.
Add a sound source to your player or use an existing one. [SerializeField] or public an AudioSource variable and an AudioClip variable to target it in the inspector, and then in the script call: varToAudioSource.clip = varToSoundFile; varToAudioSource.Play();
I would suggest creating a loot anchor on your player, then a loot prefab similar to the pickup from earlier in this series, and then just instantiate loot on loot anchor and unlink from player before destroying the player
Why not make a function on your object called "Package"? That way you have the logic where it's most logical, and you can call it from multiple places if need be without having to copy your code.
Same goes for unpacking; you could also have a more structured and less error prone way of doing things, like: if (data[0] is string userName) then you have your type check + cast to the proper type. When the if fails, you know you have messed up your communication and can raise the appropriate error.
@@nkusters I do this in my own projects - too much to explain in one video - it's just to show the idea to others - acute programmers can use the concepts in their own style of course
Hey Welton! I finally started using your tutorials! (like 2 weeks ago but ok) Anyway, I wanted to give you some ideas for some other tutorials! Time till a match ends/kills till a match ends, teams (think I saw a comment about that), lag compensation (photon has doc on that but it would be cool if cover it) maybe a better menu. I know is just a simple tutorial to show the basics but just in case you are running out of ideas there's some!
To anybody having trouble out there: I had trouble getting RaiseEvent to trigger OnEvent, found out you need to register each object to get the event handler callback by adding these two functions at the top of your Manager script:
public void OnEnable()
{
PhotonNetwork.AddCallbackTarget(this);
}
public void OnDisable()
{
PhotonNetwork.RemoveCallbackTarget(this);
}
ah thanks so much
thanks a lot
Thank you I saw your comment I was struggling i didn't understand why the information wasn't receiving
I have been pulling the code apart, trying to debug this for hours now! Thank You so much for finding that and commenting! absolutely saved my day!!!
amazing stuff
lovely content
Hi bro, I hope you make a video about matchmaking :)
P.S. Your channel is the best on the PUN 2 on unity3
Love your vids. Can you do a tutorial on a settings menu?
Hey! I got one question. Why wouldn't you just set this stats as a PlayerCustomProperty. Or is that not a good idea?
Hi Bro, I got an Error: ArgumentNullException: Value cannot be null. Parameter name: key(referring to Spawn() and Start() function) I don't know what to do, but I coded everything that you have done in the tutorial. All my UI worked, but after clicking Create (in Create Room) I was not able to play. Another thing was, I was not able to get any room list (Room List) even after I created a Room (there was no button popped up like yours in Room List in tutorial 45). Got any idea how to get rid of this Error? please help me out, Bro.
same here
@@neozoido Hey Hi, go to your Map > Manager(Gameobject), in the Inspector fill the empty Player_perfab_string with your Player prefab's name and drag and drop the Player prefab in Player_prefab. This worked for me!
Try it out Bro...
@@punisherioi yeah I figured it out
@@punisherioi thanks anyways!
bro every one of ur videos i was able to understand but this gets over my mind i can copy the code but i cant understand this if someone can give me a link for a deep explaination about this it would be great edit no need now spent alot of time digging everything in it and got a good knowledge now
Just in case someone is adapting this for their own game. Since the ChangeStat functions use byte for their actor and amt variables, you will only be able to send a packet of up to 255 per variable. So you can only update 255 variables to a max value of 255. Meaning, if you have a game where someone has over 255 kills, it will break this script unless the type is updated from a byte to a short or larger. Also, the byte type is unsigned, meaning that you can't send negative values
Also, for funsies, the actor is saved with an int variable which is a signed 32-bit variable, so you can have a minimum of -2,147,483,648 players and a maximum of 2,147,483,647 players in a room.
After my player dies nothing happens no debug.log help?
public void OnEnable()
{
PhotonNetwork.AddCallbackTarget(this);
}
public void OnDisable()
{
PhotonNetwork.RemoveCallbackTarget(this);
}
again DONT workin
Can you make a tutorial on how to add sound when your dying or walking? Love your vids btw
that's something that there are already tutorials for, you just have to integrate them into this project. It shouldn't be too hard, just tell it to play a sound if the player has died, or if he is walking.
Add a sound source to your player or use an existing one. [SerializeField] or public an AudioSource variable and an AudioClip variable to target it in the inspector, and then in the script call:
varToAudioSource.clip = varToSoundFile;
varToAudioSource.Play();
A late night installment 🤩🤩
Thank you nice Video
Loot drop after death ? How to do that plz answer
I would suggest creating a loot anchor on your player, then a loot prefab similar to the pickup from earlier in this series, and then just instantiate loot on loot anchor and unlink from player before destroying the player
Please tell me about the CCU that is the concurrent users of the Photon Pun 2. Is it for the whole game or for just a room .... Its confusing😫 😵🤯
I didn't get any log showing me my player died, any idea?
public void OnEnable()
{
PhotonNetwork.AddCallbackTarget(this);
}
public void OnDisable()
{
PhotonNetwork.RemoveCallbackTarget(this);
}
cann you make sild
Yippie!
"Set up" is the verb. "Setup" is a noun.
Why not make a function on your object called "Package"? That way you have the logic where it's most logical, and you can call it from multiple places if need be without having to copy your code.
Same goes for unpacking; you could also have a more structured and less error prone way of doing things, like:
if (data[0] is string userName) then you have your type check + cast to the proper type. When the if fails, you know you have messed up your communication and can raise the appropriate error.
@@nkusters I do this in my own projects - too much to explain in one video - it's just to show the idea to others - acute programmers can use the concepts in their own style of course