So, I notice:
Room.UserList
and
SFS.UserManager.GetUserList()
I'm firing a method to loop through and create the players after joining a Room of course.
But neither of the above are being consistent for me. When I join a room I need to Instantiate all the players who have already joined that room. UserEnter and UserExit work fine--but, for the life of me I can't get all the users that are already there, to spawn in.
Any posts or advice on this?
Thanks!
Spawning Players Already in a Room in Unity
Re: Spawning Players Already in a Room in Unity
Hi,
those two lists are not the same thing:
Seems very strange as we have no reports of this, nor we've ever seen it.
Can you provide a repro-case so that we can check it out?
Also please specify the SFS2X version and client API version in use.
Thanks
those two lists are not the same thing:
- Room.GetUserList() returns all users in the Room(*)
- SFS.UserManager.GetUserList() gives all the Users that you're currently able to interact with, in case you're joined in multiple Rooms.
for the life of me I can't get all the users that are already there, to spawn in.
Seems very strange as we have no reports of this, nor we've ever seen it.
Can you provide a repro-case so that we can check it out?
Also please specify the SFS2X version and client API version in use.
Thanks
Re: Spawning Players Already in a Room in Unity
So,
The problem was simple. I had a coroutine that waited for all the users to instantiate and then "showed" them.
Like one second or so, just enough time to give Unity to load them. But for some reason, the weren't visible in Game Mode. I switched over to the Editor view out of Game Mode and noticed a bunch of Collision Wire Frames where the players were. So, they were there! Just not visible yet.
Had nothing to do with the player count!
I used Room.GetUserList() since I need all the players in that single room. But, thanks for explaining that Lapo. That information was
useful!
Everything on this front is fine now.
Thanks,
Idle Chimp
The problem was simple. I had a coroutine that waited for all the users to instantiate and then "showed" them.
Like one second or so, just enough time to give Unity to load them. But for some reason, the weren't visible in Game Mode. I switched over to the Editor view out of Game Mode and noticed a bunch of Collision Wire Frames where the players were. So, they were there! Just not visible yet.
Had nothing to do with the player count!
I used Room.GetUserList() since I need all the players in that single room. But, thanks for explaining that Lapo. That information was
useful!
Everything on this front is fine now.
Thanks,
Idle Chimp
Re: Spawning Players Already in a Room in Unity
Thanks for the update
Who is online
Users browsing this forum: No registered users and 43 guests