Hi Justin,
I'm having an issue with setting up a multi character selection. What's happening is when the second character enters the room they and the master client character work on in their view, but the second character is not updated in the master client's view. They have been instantiated but they are not recieving any updates.
I have the spawn point slightly above the terrain and in the Master client view the second player doesn't even fall, they are stuck in the air, while on their client view they are moving around fine.
I should add that do I have the character prefabs added to the Pun Object Pool Spawnable Prefabs list.
Any suggestions of what could be causing this? I've been on this for a while and am at a complete loss. Thanks in advance, Nathan
I'm having an issue with setting up a multi character selection. What's happening is when the second character enters the room they and the master client character work on in their view, but the second character is not updated in the master client's view. They have been instantiated but they are not recieving any updates.
I have the spawn point slightly above the terrain and in the Master client view the second player doesn't even fall, they are stuck in the air, while on their client view they are moving around fine.
I should add that do I have the character prefabs added to the Pun Object Pool Spawnable Prefabs list.
Any suggestions of what could be causing this? I've been on this for a while and am at a complete loss. Thanks in advance, Nathan
Code:
[SerializeField] protected GameObject m_Character;
[SerializeField] protected GameObject[] characterArray;
// [SerializeField] protected GameObject m_CustomCharacter;
public GameObject Character { get { return m_Character; } set { m_Character = value; } }
/// <summary>
/// Abstract method that allows for a character to be spawned based on the game logic.
/// </summary>
/// <param name="newPlayer">The player that entered the room.</param>
/// <returns>The character prefab that should spawn.</returns>
protected override GameObject GetCharacterPrefab(Player newPlayer)
{
if (newPlayer.CustomProperties != null)
{
var character = newPlayer.CustomProperties["Character"];
for (int i = 0; i < characterArray.Length; i++)
{
string tempName = characterArray[i].name;
if (tempName.Equals(character))
{
print(tempName + "has entered the secene");
m_Character = characterArray[i];
}
}
}
return m_Character;
}
Last edited: