Jump to content
This site uses cookies! Learn More

This site uses cookies!

armedunity.com uses cookies to improve user experience.

By continuing to use this site, you agree to allow us to store cookies on your computer.

xfukecx

Member
  • Content Count

    85
  • Joined

  • Last visited

Community Reputation

11 Good

1 Follower

About xfukecx

  • Rank
    Member

Profile Information

  • Gender
    Male
  • Location:
    Moon

Recent Profile Visitors

495 profile views
  1. Try this if (Input.GetKeyDown(KeyCode.B) && pausemenu.active == false); { pausemenu.SetActive(true); WeaponUI.SetActive(false); WeaponSound.SetActive(false); } else if (Input.GetKeyDown(KeyCode.B) && pausemenu.active == true); { pausemenu.SetActive(true); WeaponUI.SetActive(false); WeaponSound.SetActive(false); }
  2. I dont think photon allows communication outside of rooms. I'd have to see your chat script and friends
  3. in the send message RPC add an if statement if so it only sends to people on his friends list.
  4. That would work, but in very big projects it could cause delays or lag. Instead you should update the profile with every call or something like that.
  5. you could add a parameter string Mapname in function, and set the map name as that
  6. public void Play() { if (!PhotonNetwork.insideLobby) return; foreach (RoomInfo room in PhotonNetwork.GetRoomList()) { if ((bool)room.CustomProperties["Lobby"] == true && room.PlayerCount < room.MaxPlayers && room.IsOpen && room.IsVisible) { PhotonNetwork.JoinRoom(room.name); return; } } string[] LobbyOptions = new string[1]; LobbyOptions[0] = "Map"; ExitGames.Client.Photon.Hashtable customProperties = new ExitGames.Client.Photon.Hashtable() { { "Map", "mapname" } }; RoomOptions roomOptions = new RoomOptions(); roomOptions.IsVisible = true; roomOptions.IsOpen = true; roomOptions.MaxPlayers = (byte)24; roomOptions.CustomRoomPropertiesForLobby = LobbyOptions; roomOptions.CustomRoomProperties = customProperties; PhotonNetwork.CreateRoom(null, roomOptions, TypedLobby.Default); } ok, to display map name you do room.CustomProperties["Map"].toString(); and for max players you do room.maxPlayers;
  7. Hmm. I've added if(Application.loadedLevel == 0) { PhotonNetwork.SetSendingEnabled(0, false); Debug.Log("Sending disabled"); } to my network manager, and when new scene loads it sets it back to true, but it doesnt fix it :/
  8. So I'm currently working on a multiplayer game using photon, and I have a problem. When I join a room that has already started, and it loads the scene, it instantiates network objects in original scene and then deletes them when new scene loads. How would I go about fixing that? Code: if(PhotonNetwork.inRoom && Application.loadedLevel == 0) { PhotonNetwork.LoadLevel(2); } So first it joins the room by clicking on the join button, then when its in the room it loads the level.
  9. send your name to the target, if the target is 0 hp, then lasthitby = playername. something like this: using UnityEngine; using System.Collections; using UnityEngine.UI; public class KillCount: MonoBehaviour { public string LastHitBy; public int Health = 100; // Use this for initialization void Start () { } // Update is called once per frame void Update () { } void LHB(string PlayerName) { //if the gun deals for example 25 damage do this if(Health == 25) { LastHitBy = PlayerName } } } and the other script using UnityEngine; using System.Collections; using UnityEngine.UI; public class GuUn: MonoBehaviour { public string PlayerName // Use this for initialization void Start () { } // Update is called once per frame void Update () { if(Hit.tag == "Player") { // your commands Hit.GetComponent<KillCount>().LHB(PlayerName); } } } this might work, btw wrote it in 5 mins so there might be some errors
  10. Are you using photon or unity networking?
  11. xfukecx

    UI ServerList

    Solved, thanks for your help
×
×
  • Create New...