#Thread to not spam ~
1 messages · Page 1 of 1 (latest)
IEnumerator ReadyUp()
{
if (!_isReady)
{
if (_selectedDeck == null)
{
SetStatusText("No hay ningun mazo seleccionado", 2f);
_readyButton.interactable = false;
_openDeckSelectButton.interactable = false;
yield return _oneSecondWaitTime;
yield return _oneSecondWaitTime;
_readyButton.interactable = true;
_openDeckSelectButton.interactable = true;
yield return null;
}
else
{
_isReady = true;
_readyButton.interactable = false;
_openDeckSelectButton.interactable = false;
yield return _oneSecondWaitTime;
_readyButton.interactable = true;
//If both players are ready, StartGame();
}
}
else
{
//Set player as not ready
Debug.Log("Player not ready anymore.");
_isReady = false;
_readyButton.interactable = false;
yield return _oneSecondWaitTime;
_readyButton.interactable = true;
_openDeckSelectButton.interactable = true;
}
ChangeReadyStatusRpc(_currentSession.IsHost, _isReady);
}```
[Rpc(SendTo.Server)]
void ChangeReadyStatusRpc(bool isHost, bool isReady)
{
string x = isHost ? "Host" : "Guest";
string y = isReady ? "Ready" : "Not Ready";
Debug.Log("This is being called");
Debug.Log($"{x} is {y}");
if (isHost)
_isHostReady.Value = isReady;
else
_isGuestReady.Value = isReady;
}```
When is ReadyUp() getting called? And which object is it on? Personally, I would use Player Properties for "Ready". Or a network variable with owner write permissions on the player object
oh, ReadyUp() is being called
with a button
in the same script everything else is
Is that Lobby Room manager a Network Behavior?
I just realized it is a MonoBehaviour...
XDDDDDDDD
playerproperties, they can only be strings?
should it be?
yes. Network Variables and RPCs have to be in Network Behavors on Network Objects
no ||fucking|| way XDDDDDDDDDD
I missed that one :v
I changed it to a property tho
more comfortable to work with
but I'll take that in mind
Also yes, this does have to be a string
just be careful not to over use them. Lobby bandwidth is 10GB/month
oh
I don't... I hope I don't get to 10GB per month? XD
but thanks for the advice
you will likely never reach that limit unless you are doing something crazy. but I sometimes forget its there
hey evil
you ever dealt with authentication?
other than... Anonymous
I have seen you make videos, I did watch a full one
never really touched things I needed but I feel like they're very informative and I was wondering
if you're ever going to make one about it (Authentication)
I swore we did. But yea, I've used Unity Player Accounts before. Its a bit tricky to get the log in with Google working
yeah... I did try that and gave up
XDDDDDDDDDDDDDD
I want it in my game... but I just couldn't do it
not by my own :'v
Using Username/Password is super easy to get going though
I'll see if we can bang out a quick Authentication video this week.
so far this is what I got
I need to handle when player quits, delete lobbies and such
for now, I think I want to move on with the game and come back to this later
since I already have player connection and stuff
c: nice, looking forward to it
now, I want to move all my players to another scene
do I need to keep this script alive?
make it a "Don't Destroy On Load"
You don't have to.